Code-Blogs
EMail:    
Password:     Forgot Password
generic type with namespace restriction?

Everyone knows

public class Test<T> where T : SomeBaseClass

But is there a way to restrict T to classes that exists in a namespace like

public class Test<T> where T in SomeNamespace

Best regards

 
Comments
Comment No 1

No. There''s no way to constrain a generic type to a namespace.

Post your comment
E-Mail:    
Reply:  
Text ColorBackground Color
BoldItalicUnderline
LeftCenterRightJustify
Ordered ListBulleted List
IndentOutdent
Horizontal Rule
SubscriptSuperscript
HyperlinkImage
Design ModeDesign
Html ModeHtml
   
 
Suggestions _