enum and tuples

captaindet 2krnk at gmx.net
Fri Aug 9 12:41:35 PDT 2013


On 2013-08-09 11:36, Ali Çehreli wrote:
> as I am in the process of revising and translating a Tuples chapter.

thanks for the reply, Ali.

as a matter of fact, i am checking your website regularly, eagerly awaiting the translations of the tuples chapter. and the __traits and the template chapter too ;)

your examples make things a bit clearer in general, but not in the specific case of enums. i investigated my enum cases a bit more and it seems that enums of string value typetuples are good-natured expression by far and large, only pragma(msg, X) fails terribly.

enum X = TypeTuple!("only", "strings", "here"); // fine everywhere but pragma(msg

hovever, enums of integer or float value typetuples throw a phobos error when appearing outside of main(), but work alright within main()

enum er = TypeTuple!(1,2,3); 	// ...\utf.d(1147): Error: cannot cast int to (int, int, int)

void main(){
	enum er = TypeTuple!(1,2,3);		// fine
}


quite mysterious.

/det


More information about the Digitalmars-d-learn mailing list