[Issue 15419] std.conv.parse() does not accept string literals
https://issues.dlang.org/show_bug.cgi?id=15419 --- Comment #6 from github-bugzi...@puremagic.com --- Commit pushed to stable at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/8da9dbc2ae7a80be15a9cda8e5824cb9501178b1 Merge pull request #3861 from tsbockman/size_of_china --
[Issue 15419] std.conv.parse() does not accept string literals
https://issues.dlang.org/show_bug.cgi?id=15419 thomas.bock...@gmail.com changed: What|Removed |Added Severity|trivial |enhancement --- Comment #3 from thomas.bock...@gmail.com --- I just realized that you were the one who changed the importance to "enhancement". I thought I had just forgotten to set it initially, since "enhancement" is the default; I wasn't trying to undo your change. --
[Issue 15419] std.conv.parse() does not accept string literals
https://issues.dlang.org/show_bug.cgi?id=15419 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --
[Issue 15419] std.conv.parse() does not accept string literals
https://issues.dlang.org/show_bug.cgi?id=15419 --- Comment #4 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/8da9dbc2ae7a80be15a9cda8e5824cb9501178b1 Merge pull request #3861 from tsbockman/size_of_china Fix Issue 15419 - "@@@BUG@@@ the size of China" --
[Issue 15419] std.conv.parse() does not accept string literals
https://issues.dlang.org/show_bug.cgi?id=15419 thomas.bock...@gmail.com changed: What|Removed |Added Resolution|FIXED |WONTFIX --- Comment #5 from thomas.bock...@gmail.com --- Marking this as WONTFIX. A real fix would either: 1) Use `scope ref`, if it is ever implemented, or 2) Use the `auto ref` like so (to minimize template bloat): template parse(Target, Source) if(/+constraints+/) { private Target impl(ref Source s) { /+implementation+/ } pragma(inline, true) Target parse(auto ref Source s) { return impl(s); } } The later should completely fix the problem, and be fully backwards compatible. However, it would be a large diff and might confuse ddoc, too. --
[Issue 15419] std.conv.parse() does not accept string literals
https://issues.dlang.org/show_bug.cgi?id=15419 thomas.bock...@gmail.com changed: What|Removed |Added Severity|enhancement |trivial --- Comment #2 from thomas.bock...@gmail.com --- I'll close this once the unittest has been cleaned up, then. It would still be cool to see this a real fix with `scope ref` some day, though. --
[Issue 15419] std.conv.parse() does not accept string literals
https://issues.dlang.org/show_bug.cgi?id=15419 yebblieschanged: What|Removed |Added CC||yebbl...@gmail.com Hardware|x86_64 |All OS|Linux |All Severity|trivial |enhancement --- Comment #1 from yebblies --- >From the description of parse: 'takes the input by reference and advances it to the position following the conversion' This is intentional API design, and therefore not a bug. The compiler used to be very sloppy about what it accepted as an lvalue, so those test cases did work at one point. The workaround is just to use 'to' instead of 'parse', which takes an rvalue argument. --