Do strings with enum allocate at usage point?

"岩倉 澪" via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Mar 17 12:00:16 PDT 2015


On Tuesday, 17 March 2015 at 18:25:00 UTC, Ali Çehreli wrote:
> Strings are fine and fortunately it is very easy to test:
>
> enum arr = [ 1, 2 ];
> enum s = "hello";
>
> void main()
> {
>     assert(arr.ptr !is arr.ptr);
>     assert(s.ptr    is s.ptr);
> }
>
> Ali

Ah, that is good to know. Thanks!


More information about the Digitalmars-d-learn mailing list