compile time output

Trass3r mrmocool at gmx.de
Tue Jan 20 14:16:28 PST 2009


This works:

template classMixin()
{
static this()
{
	const string[] members = __traits(allMembers, typeof(this));
	pragma(msg, foo(members));
}
}

string foo(const string[] members)
{
	string result;
	foreach(m; members)
		result ~= m ~ " ";
	return result;
}


But there must exist a better solution to this.


More information about the Digitalmars-d-learn mailing list