Tech Off Thread

3 posts

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.)   

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.