Generic Where T Implements and Alias?

About Monkey 2 Forums Monkey 2 Programming Help Generic Where T Implements and Alias?

This topic contains 3 replies, has 2 voices, and was last updated by  Mark Sibly 2 years, 5 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #5104

    skn3
    Participant

    I have the following base class:

    [/crayon]

    And then I have the following alias:

    [/crayon]

    The animation class is defined as:

    [/crayon]

    Is this possible?

    Psst Mark, I think single line code style is broken on the site testing testing this is too bright

    #5113

    Mark Sibly
    Keymaster

    Where doesn’t work with classes yet, but apart from that, try it and see!

    #5121

    skn3
    Participant

    It does not work 😉 You confirmed with your answer. I wasn’t sure if I had the syntax wrong.

    #5122

    Mark Sibly
    Keymaster

    I’m holding off until I add ‘overloaded’ classes before adding class where.

    It’ll still work without the where, you’ll just get different errors if you do the wrong thing (ala c++). Since there is only one possible ObjectListView<T> class, where can’t help ‘select’ an overload to use the way it can with functions.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.