deriving from System.ValueType?

Should I derive my objects from System.ValueType

I think this would be ok if my objects consist of just value types. If it doesn't, I'm not sure what will happen. Maybe the compiler make the choice for me

Thanks

Jason



Answer this question

deriving from System.ValueType?

  • Suscuaja

    Rather than trying to inherit from System.ValueType to make your object a value type... make it be a struct instead of a class.

    While System.ValueType exists, you never explicitly inherit from it, instead anytime you create a class you are implicitly using a reference type while when you make a structure you are using a value type.



  • MobilTech

    Sorry, I'm being stupid - the compiler won't let me derive from System.ValueType!!


  • deriving from System.ValueType?