Why Nostr? What is Njump?
2024-03-09 13:56:19
in reply to

Florian Xaver on Nostr: npub1w5z27…8rl8t Roughly, std::move cast to rvalue reference. Then, instead of a ...

Roughly, std::move cast to rvalue reference. Then, instead of a copy constructor*, a move constructor* is used, which often does what is called "shadowed copying" in C. The copy constructor of a unique_ptr is deleted.

Moved-from objects are valid objects, but everything else is undefined and depends on implementation and optimization of the compiler. So, a smart pointer like unique_ptr could wrap a nullptr in theory, but most probably does not.

* or assignment operator
Author Public Key
npub15vpp8azctmz068rgel4ns228k38jjzhe5zznss4yj7m7tmezgt5sk48k3y