[Development] Wishes for C++ standard or compilers
thiago.macieira at intel.com
Mon Mar 20 22:19:11 CET 2017
Em sábado, 18 de março de 2017, às 14:20:49 PDT, Thiago Macieira escreveu:
> == Containers ==
> And then there's what to do with the containers. Here's where Marc's opinion
> and mine differ considerably. Aside from the need to maintain source
> compatibility, I feel like we should keep our containers and keep implicit
> sharing (same solution as for QString). We know COW can be a pessimisation
> for performance-sentive code, but the question is whether it is so for
> regular developers who don't know how to write performance-sensitive code.
> If developers will make mistakes, can we reduce the impact?
Here's another wish that I remembered: destructive move a.k.a. relocation.
The destructive move is a special case of move in which the source is also
detroyed in the process, as opposed to the regular move in which its contents
get moved but the destructor is still called and the object is still in a
valid (but unspecified) state.
Then we have an even more special case of destructive move: trivial
destructive move (trivial relocation), which is just a memcpy. A type with
trivial move constructor and trivial destructor is trivially relocatable too,
since the trivial destructor does nothing and the trivial move constructor is
memcpy. However, the trick is to implement the relocation for non-trivial
Note that this needs the discussion on the lifetime of trivial types to be
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
More information about the Development