import std.stdio; enum ABC { a, b, c } void main() { writeln(ABC.stringof); } // prints "int" This causes major issues in reflective and serialization code. The .stringof should evaluate to the name of the enum, e.g. "ABC".
d-bugmail@puremagic.com escribi
I have to deal with this problem in a template function that is used with a lot of different enum types (by some other bigger templates). But not handled enum types hit a static assert. I wrote different template functions before but hit some limitations that forced me to put everything in the same function using static ifs. Because T.stringof is almost always "int", I have a hard time to find out what enum is not handled. I hope this problem will be addressed soon.
this issue is also in latest V1 so switching the version to that
Fixed in DMD 1.037 and 2.021
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル