Tech Off Thread

3 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

How do I apply generic constraints to: void MyFunction<T1, T2>() {}?

Back to Forum: Tech Off
  • User profile image
    dcuccia

    I've tried the following...

    void MyFunction<T1, T2>() where T1, T2 : struct {}

    void MyFunction<T1, T2>() where T1: struct , T2 : struct {}

    void MyFunction<T1, T2>() where T1: struct ,  where T2 : struct {}

    ...but alas, I'm stumped. Please help!

  • User profile image
    stevo_

    void MyFunction() where T1 : struct where T2 : struct {} Commence self kick Wink

  • User profile image
    dcuccia

    stevo_ wrote:
    void MyFunction() where T1 : struct where T2 : struct {} Commence self kick


    Ouch! Expressionless

    (Thanks.)   

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.