On 31.08.2015 11:12, Enamex wrote:
On Monday, 31 August 2015 at 07:55:53 UTC, drug wrote:
Hello
I need to get the type to which I can cast the enum for using with
foreign library. For example:
```
enum Foo { A = "a", B = "b", }
enum Bar { A = 123, B = 432, }

static assert(is(BaseEnumType!Foo == string));
static assert(is(BaseEnumType!Bar == int));

I guess there is simple answer somewhere but I failed to find it yet.

Use
     is(std.traits.OriginalType!Foo == string)
maybe?
Yes, it works, thank you!

Reply via email to