c# - How to inherit from a generic parameter? -


I want to do this originally:

  class UILockable & lt; T & gt; : T where t: UIWidget {}  

However, it does not work I have noticed that people recommend that you do this:

  Class UILockable & lt; T & gt; Where T: UIWidget {Private T_base; }  

This will require me to override each function UILockable and it must be forwarded to T. Since T can be obtained from UIWidget and its exclusive abstract / virtual methods can be obtained.

Are you just in succession?

You can not take the heirs from normal type parameters to C # generic C ++ templates are very different from them. To inherit type parameter, the class requires a completely different presentation based on type parameter, which is what happens with NAT generics. They are identical at IL and at the original level (for all reference type arguments).


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -