C# Multiple generic constraints -
I was wondering if it is possible to add more than one common obstacle?
I have an add method that takes an object (either email, phone or address), so I was thinking something like this:
add public zeros ; T & gt; (T obj) where t: know where t: email where t: call {if (Obj know) m_Address.Add (Obj as address); Else if (obj is email) m_Email.Add (obj as email); Other m_Phone.Add (Obj as phone); } I continue: "A restriction section has already been specified for the parameter 'T'. You can not do this because there are not only three ways and the compilers work hard for you?
Comments
Post a Comment