[Issue 5515] std.conv.to for safer enum casts

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue May 22 09:36:08 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=5515

Dmitry Olshansky <dmitry.olsh at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
                 CC|                            |dmitry.olsh at gmail.com
         Resolution|---                         |FIXED

--- Comment #6 from Dmitry Olshansky <dmitry.olsh at gmail.com> ---
import std.conv: to;
import std.algorithm: map;
enum Foo : char { A='a', B='b', C='c' }
void main() {
    auto foos = "abcabcabc".map!(to!Foo)();
}


Compiles today, that was the last of it.

--


More information about the Digitalmars-d-bugs mailing list