January 23, 2011 Re: template alias | ||||
|---|---|---|---|---|
| ||||
Use the eponymous trick:
import std.stdio;
import std.traits;
template isBuiltInT(T)
{
enum isBuiltInT = isNumeric!T || isSomeChar!T;
}
void main()
{
assert(isBuiltInT!(int));
assert(isBuiltInT!(char));
}
| ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply