foreach over string enum

Ali Çehreli acehreli at yahoo.com
Thu Feb 10 16:02:26 PST 2011


I don't have answers to your other questions.

On 02/10/2011 03:25 PM, spir wrote:

 > unittest {
 > auto i = 1;
 > auto s = "i";

It works if you define s as:

     enum s = "i";

 > writeln(mixin("i")); // compiler happy up to here --> "1"
 > writeln(mixin(s)); // compiler unhappy --> "Error: argument to mixin
 > // must be a string, not (s)"

It now works.

Ali



More information about the Digitalmars-d-learn mailing list