Lars T. Kyllingstad:
> Why not let to!int() do this?

Because if the enum is for example:
enum ulong Foo { ... 

You are casting an ulong to int and you risk losing bits of information. That's 
why Andrei has suggested a conversion template function, because it can (I 
don't know how) find the correct base type and cast the enum to it. Andrei is 
sometimes one step forward.

Bye,
bearophile

Reply via email to