Re: Converting all enum members to a string fails with version 2.0.72.0

2016-11-29 Thread Stefan via Digitalmars-d-learn
On Monday, 21 November 2016 at 18:53:59 UTC, Stefan wrote: On Monday, 21 November 2016 at 17:26:37 UTC, Jonathan M Davis wrote: [...] Thanks Jonathan for the explanation. The cast works fine but feels "unsafe". I will wait for the next version. Stefan Version D 2.072.1 Beta fixed my prob

Re: Converting all enum members to a string fails with version 2.0.72.0

2016-11-21 Thread Stefan via Digitalmars-d-learn
On Monday, 21 November 2016 at 17:26:37 UTC, Jonathan M Davis wrote: [...] Thanks Jonathan for the explanation. The cast works fine but feels "unsafe". I will wait for the next version. Stefan

Re: Converting all enum members to a string fails with version 2.0.72.0

2016-11-21 Thread Basile B. via Digitalmars-d-learn
On Monday, 21 November 2016 at 17:26:37 UTC, Jonathan M Davis wrote: On Monday, November 21, 2016 17:01:56 Stefan via Digitalmars-d-learn wrote: [...] [...] there was an overload for toUpper that took string as an optimization but that inadvertently meant that types that implicitly converted

Re: Converting all enum members to a string fails with version 2.0.72.0

2016-11-21 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, November 21, 2016 17:01:56 Stefan via Digitalmars-d-learn wrote: > Before 2.0.72.0: > > import std.algorithm : map, joiner; > import std.uni : toUpper; > import std.traits : EnumMembers; > import std.stdio : writeln; > import std.conv: to; > > private enum Color : string { > RED = "

Converting all enum members to a string fails with version 2.0.72.0

2016-11-21 Thread Stefan via Digitalmars-d-learn
Before 2.0.72.0: import std.algorithm : map, joiner; import std.uni : toUpper; import std.traits : EnumMembers; import std.stdio : writeln; import std.conv: to; private enum Color : string { RED = "red", BLUE = "blue", YELLOW = "yellow" } void main(string[] args) { writeln( [ E