Calling functions using mixins

Dennis Ritchie via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri May 1 14:04:08 PDT 2015


hi,
Is it possible to call functions using mixins in this way?

-----
import std.stdio;

int fooTestMixin() {
	return 5;
}

void main() {

	enum t { fooTestMixin };
	immutable string[] strArr = [ "fooTestMixin" ];

	writeln(mixin(`mixin("t.fooTestMixin")`));
	writeln(mixin(`mixin("strArr[0]")`));
}


More information about the Digitalmars-d-learn mailing list