Manifest constant class instances

kinke noone at nowhere.com
Sun Nov 4 21:26:23 UTC 2018


On Sunday, 4 November 2018 at 21:08:56 UTC, kinke wrote:
> `enum c = new C()` doesn't imply that the instance lives at 
> runtime too.

To make this point clearer: this works, but the instance doesn't 
live at runtime:

```
class C { int foo() { return 123; } }
enum i = new C().foo();

void main()
{
     import core.stdc.stdio;
     printf("%d\n", i); // i is a 123 literal
}
```


More information about the Digitalmars-d mailing list