Initialize non-static members

  • Thread starter Thread starter Bumbala
  • Start date Start date
B

Bumbala

Hello,
Is it possible to initialize non-static members inside a value class
(structure) ?

Thanks.
 
Bumbala said:
Hello,
Is it possible to initialize non-static members inside a value class
(structure) ?

Thanks.

No. The constructor for a .NET value type isn't guaranteed to be called, so
it's forbidden to define a default constructor, copy constructor, assignment
operator, etc.
 
Back
Top