Make enum auto castable
Mike B Johnson via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sun Jun 4 15:52:55 PDT 2017
I am dealing with some COM stuff and some functions use VARIANT,
which can hold an enum.
Instead of having to manually convert the enum(and for that
matter, other things) to VARIANT, is it possible to have them
automatically converted?
This is because an enum is always convertible to a VARIANT but
not the other way around. So, when a enum is passed to a function
accepting a VARIANT, it should just work. Overloading is not an
option.
More information about the Digitalmars-d-learn
mailing list