indexing stuff during compile time
Eric
nil at example.com
Sun Dec 24 22:49:06 UTC 2017
Ok, solved. It appears you can sort tuples.
I am just a bit confused why I had to use tuple() while the doc
for staticSort states it works on AliasSeq.
auto groupIndex(Ts...)() {
import std.meta;
enum Comp(alias N1, alias N2) = { __traits(identifier,
typeof(N1)) < __traits(identifier, typeof(N2))};
enum t = tuple!(Ts);
enum sorted = staticSort!(Comp, t);
return GroupId!sorted.id;
}
More information about the Digitalmars-d-learn
mailing list