Bug 18397 – Poor implementation of std.conv.hexString results in unintended bloat

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-02-08T01:45:22Z
Last change time
2018-02-09T14:35:35Z
Assigned to
No Owner
Creator
Walter Bright

Comments

Comment #0 by bugzilla — 2018-02-08T01:45:22Z
import std.conv; void test() { auto data = cast(ubyte[]) hexString!"deadbeef"; } Results in quite a bit of unexpected template bloat emitted into the object file, not all of which is removed by the linker.
Comment #1 by greensunny12 — 2018-02-08T02:44:46Z
*** Issue 18395 has been marked as a duplicate of this issue. ***
Comment #2 by bugzilla — 2018-02-08T03:26:08Z
Comment #3 by dfj1esp02 — 2018-02-08T10:08:03Z
Why it creates sting literal instead of string itself? Then you could just do --- enum string hexString = hexStrImpl(hexData); ---
Comment #4 by github-bugzilla — 2018-02-09T14:35:34Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/f4f071cb8e85b25b3e73448693bc75f754293230 fix Issue 18397 - Poor implementation of std.conf.hexString results in unintended bloat https://github.com/dlang/phobos/commit/5854e6150035b18439e752b6c851f9478d521508 Merge pull request #6138 from WalterBright/fix18397 fix Issue 18397 - Poor implementation of std.conv.hexString results i… merged-on-behalf-of: Sebastian Wilzbach <[email protected]>