An Issue I Wish To Raise Awareness On
via Digitalmars-d
digitalmars-d at puremagic.com
Thu Jul 20 03:31:15 PDT 2017
On Thursday, 20 July 2017 at 10:16:21 UTC, Kagamin wrote:
> On Wednesday, 19 July 2017 at 21:50:32 UTC, Petar Kirov
> [ZombineDev] wrote:
>> Note that this doesn't play well with regular [1] value types
>> becuase e.g. you don't have control over the synthesized
>> bit-blit for this(this) and so you can't assume that structs
>> with a single pointer member are updated atomically, even if
>> would write the opAssign that way. In C++17 atomic_shared_ptr
>> has it's copy-constructor and assign operator deleted. You can
>> only do atomic<T> like ops with it and derive a plain
>> shared_ptr<T> from it, kind-of like core.atomic's
>> HeadUnshared(T).
>
> Huh? Why opAssign can't just do what atomic<T> does?
Also note that atomic<T> doesn't have neither copy constructor
nor assignment operator:
http://en.cppreference.com/w/cpp/atomic/atomic/atomic
> atomic( const atomic& ) = delete;
http://en.cppreference.com/w/cpp/atomic/atomic/operator%3D
> atomic& operator=( const atomic& ) = delete;
> atomic& operator=( const atomic& ) volatile = delete;
More information about the Digitalmars-d
mailing list