How to get BaseEnumType?
drug via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Mon Aug 31 01:12:33 PDT 2015
On 31.08.2015 11:10, wobbles wrote:
>
> In std.traits there is the required isX funcitons.
>
> import std.stdio;
> import std.traits;
> void main(){
> static if(isSomeString!Foo){
> writefln("String: %s", Foo.A);
> }
> static if(isScalarType!Bar){
> writefln("Integer: %s", Bar.A);
> }
> static if(isSomeString!Bar){
> writefln("String: %s", Foo.A); // wont print
> }
> static if(isScalarType!Foo){
> writefln("Integer: %s", Bar.A); // wont print
> }
> }
>
> enum Foo { A="a", B = "b" }
> enum Bar { A=1, B=2 }
>
Thank you. But is there a way to check against not predefined type?
More information about the Digitalmars-d-learn
mailing list