A brief sample:
alias foo = mixin(bar!T);
where var!T returns the name of a valid variable, and thus mixin' it provides access to said variable.
The previous code won't compile:
Error: basic type expected, not mixin
There is a known workaround around this issue:
alias hack(alias a) = a;
alias foo = hack!(mixin(bar!T));
But clearly it shouldn't have to be done like this.
Comment #1 by kapblc — 2016-06-17T17:12:18Z
вот так ещё можно
mixin("alias foo = " ~ bar!T ~ ";");
Comment #2 by hbaelx — 2016-07-27T19:34:36Z
After more experience with Phobos, I realized this is apparently not an issue and is intended to be done with the Alias template from the std.meta module. Rejecting my own issue I guess.
The working solution:
import std.meta : Alias;
alias foo = Alias!(mixin(bar!T));