Using enum constant from different modules

Jacob Carlborg via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jul 10 23:19:31 PDT 2014


On 10/07/14 22:48, anonymous wrote:

> I don't think this is a bug.
>
> Remember that enums have copy-paste semantics. So, this is the
> same as comparing literals from different modules. Apparently, in
> the same module, a duplicate string literal is optimized out. But
> that's not done across the module boundary. I'd guess that's
> because of the separate compilation model.

That seems to be the case. I just got confused about the different 
behavior when put in a single or two modules.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list