No we should not support enum types derived from strings

deadalnix deadalnix at gmail.com
Wed May 12 02:07:14 UTC 2021


On Wednesday, 12 May 2021 at 01:58:39 UTC, 12345swordy wrote:
> No, classes are reference types, structs are values types in c#.
>
> -Alex

No, both are value type, but in the case of the class, the value 
contains a reference to the payload that you describe in the 
class's body. Consider:

class A {}
A a = new A();

void foo(A ainfoo) {
     ainfooo = new A();
}

foo(a);

Was "a" modified here? No it wasn't.


More information about the Digitalmars-d mailing list