fix Issue 14432 - move construction for RefCounted#3171
fix Issue 14432 - move construction for RefCounted#3171JakobOvrum merged 3 commits intodlang:masterfrom
Conversation
std/typecons.d
Outdated
There was a problem hiding this comment.
You can't use enforce for malloc, use core.exception.onOutOfMemoryError.
See also #3031.
- add RefCounted!T.this(T) which takes an RValue or a copy and use move to initialized the refcounted store - add refCounted to infer T from the argument and disable RefCounted's autoInit, also move initializes the store
std/typecons.d
Outdated
There was a problem hiding this comment.
Why put this in TLS instead of the stack? Could also use typeid(T).init() like destroy does.
There was a problem hiding this comment.
Mmh, I just copied the move code. Updated.
|
Also changed move to use |
|
Once #3139 is ready, we should specifically handle promoting a Unique!T to a RefCounted!T. |
|
LGTM |
|
Well then go ahead merge it ;). |
|
Ideally a third person would look over it, but it's already been 10 days so... |
|
Auto-merge toggled on |
fix Issue 14432 - move construction for RefCounted
Ideally we'd handle PR within a few days. |
and use move to initialized the refcounted store
RefCounted's autoInit, also move initializes the store