Assignment to "enumerated string", is content copied or array information?

tcak via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Oct 18 16:51:51 PDT 2014


enum Values: string{
   NONE = "",
   Value1 = "Apple",
   Value2 = "Peach",
   Value3 = "Lemon"
}


Values lastHeldValue = Value3;


Is the "lastHeldValue" just "pointer + length" information, and it
points to "Lemon"; or is "Lemon" copied to another place in 
memory?

I am doing comparison as "if( lastHeldValue == Value3 )" and am 
not
sure what comparison operation it is doing in the background.


More information about the Digitalmars-d-learn mailing list