J
Jesper
Hi,
Are there any serious drawbacks using a class instead of
struct to implementing your own type.
I a textbook of mine on C# the author recommend operator
overloading on value types only. Apparantly based on some
argument that e.g. the ++ operator is more complex to
implement. Can this really be his only reason for this
argument?
Moreover, in a struct, the same aurthor defines the
following
struct Hour
{
.....
.....
private int value;
}
Does he obtain something special using the value keyword
as a field of the struct?
Best regards Jesper
Are there any serious drawbacks using a class instead of
struct to implementing your own type.
I a textbook of mine on C# the author recommend operator
overloading on value types only. Apparantly based on some
argument that e.g. the ++ operator is more complex to
implement. Can this really be his only reason for this
argument?
Moreover, in a struct, the same aurthor defines the
following
struct Hour
{
.....
.....
private int value;
}
Does he obtain something special using the value keyword
as a field of the struct?
Best regards Jesper