Bug 16108 – `to!string` fails on struct with disabled postblit

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P3
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-06-01T08:25:05Z
Last change time
2018-01-05T13:28:54Z
Assigned to
No Owner
Creator
Eyal Lotem
Depends on
16168

Comments

Comment #0 by eyal.lotem — 2016-06-01T08:25:05Z
When using `@disable this(this)` on a struct, `to!string` fails on it. to!string should probably be changed to pass by reference.
Comment #1 by eyal — 2016-06-06T09:51:14Z
This seems related #9489. Fixing this should probably involve overloading all the relevant methods in std.conv to support taking by ref as well as by-value.
Comment #2 by eyal — 2017-05-23T21:40:13Z
This makes it slightly more painful to do some kinds of types representing resources in D.
Comment #3 by jack — 2017-05-24T17:28:23Z
Hmm, fixing this has me down a rabbit hole. to!string relies on std.format for all conversions of aggregate types, and all of std.format copies as well. This is going to be a very ugly PR.
Comment #4 by jack — 2017-05-24T17:32:03Z
(In reply to Jack Stouffer from comment #3) > Hmm, fixing this has me down a rabbit hole. > > to!string relies on std.format for all conversions of aggregate types, and > all of std.format copies as well. This is going to be a very ugly PR. Scratch that. Someone thought ahead and there's a function in std.format for this. Fix soon
Comment #5 by jack — 2017-05-24T17:39:41Z
Comment #6 by github-bugzilla — 2017-06-11T03:32:35Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/3d80936f0b1e56418d6826180a7a9dbb29e01b7f Fix Issue 16108: tostrings fails on struct with disabled postblit https://github.com/dlang/phobos/commit/4f2d89bc5721a2fbc75ca167b304c70fa8e81ba3 Merge pull request #5425 from JackStouffer/issue16108 Fix Issue 16108: to!string fails on struct with disabled postblit merged-on-behalf-of: Sebastian Wilzbach <[email protected]>
Comment #7 by github-bugzilla — 2017-06-17T11:34:51Z
Commits pushed to stable at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/3d80936f0b1e56418d6826180a7a9dbb29e01b7f Fix Issue 16108: tostrings fails on struct with disabled postblit https://github.com/dlang/phobos/commit/4f2d89bc5721a2fbc75ca167b304c70fa8e81ba3 Merge pull request #5425 from JackStouffer/issue16108
Comment #8 by github-bugzilla — 2018-01-05T13:28:54Z
Commits pushed to dmd-cxx at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/3d80936f0b1e56418d6826180a7a9dbb29e01b7f Fix Issue 16108: tostrings fails on struct with disabled postblit https://github.com/dlang/phobos/commit/4f2d89bc5721a2fbc75ca167b304c70fa8e81ba3 Merge pull request #5425 from JackStouffer/issue16108