
Contracts
CppCast
00:00
The Importance of Trivial Relocation in C++
We're really trying to get out of sort of from our library experience at Bloomberg into the standard is trivial relocation which is this ability to end the lifetime of an object and start a lifetime of another object as a single operation where all that operation needs to do is memcopy. The 90% case for types is that they are trivial when they relocate like anything that just owns external resources if you promise not to destroy the source object and you are going to transfer ownership. All you have to do is pick copy everything over and then just throw away the old object completely and you're golden so trivial trivial location covers the vast majority of types. If we had a way to express it and make it well
Transcript
Play full episode