Nothing is better than copy or move - Roger Orr [ACCU 2018]

  Рет қаралды 7,091

ACCU Conference

ACCU Conference

Күн бұрын

C++11 introduced 'move semantics' to facilitate transferring the contents of one object to another more efficiently than creating a copy and then erasing the original. This is particularly focussed on optimising the performance of temporary objects, such as when passing them into or out of a function call.
However, in all the discussions about copying and moving it is easy to forget that not creating an object in the first place may be even more efficient. This can be something done by design choice, or an optimisation applied during compilation. For example, introduction of a temporary object by copying can be removed; this is is called 'copy elision' in C++ and has been permitted in the language for many years.
C++17 adds some additional specification around the creation of temporary variables with the phrase 'temporary materialization'.
This presentation will look at some 'worked examples' of how this behaves in practice, and some things to be aware of.

Пікірлер: 9
@mjKlaim
@mjKlaim 6 жыл бұрын
Just wanted to say that your fixes of the different videos have been noticed and appreciated. Thanks for the effort, I know it's a lot of time to spend in.
@ACCUConf
@ACCUConf 6 жыл бұрын
Thats very kind of you to say, we put a lot of effort into producing the videos, but with between 60-80 talks all averaging 1hr and 30 minutes its difficult to review all of the talks in their entirety.
@mjKlaim
@mjKlaim 6 жыл бұрын
No problem, I think as long as you react to feedback it's fine. You have been very fast, fast enough for me to remark :)
@cgoobes
@cgoobes 6 жыл бұрын
Awesome job though. There is one slide you missed ( the one after the 32 bit 64 bit slide around the 57:30 marker about the linux stuff ).
@tebes9265
@tebes9265 3 жыл бұрын
In contrast to what is being said in the talk, temporary materialization does NOT occur when initializing an object from a prvalue of the same type. Such objects are directly initialized by the prvalue. He is talking about the same concept, but e.g. saying "temporary materialization into x" (~ 44:00) is just misleading as there is no temporary materialization involved. Refer to cppreference (temporary materialization), for example.
@max0x7ba
@max0x7ba 6 жыл бұрын
Quite insightful about copying.
@FranciscoCrespoOM
@FranciscoCrespoOM 5 жыл бұрын
Very meaningful!
@hl2mukkel
@hl2mukkel 4 жыл бұрын
Great talk!
@aaronmacdougall
@aaronmacdougall 2 жыл бұрын
C++ has become so complicated. None of this nonsense is necessary to write good code.
C++ Today: The Beast is Back - Jon Kalb [ACCU 2018]
1:02:17
ACCU Conference
Рет қаралды 17 М.
CppCon 2018: Jason Turner “Surprises in Object Lifetime”
1:01:28
La final estuvo difícil
00:34
Juan De Dios Pantoja
Рет қаралды 29 МЛН
100😭🎉 #thankyou
00:28
はじめしゃちょー(hajime)
Рет қаралды 53 МЛН
Do you have a friend like this? 🤣#shorts
00:12
dednahype
Рет қаралды 51 МЛН
Let's Look at Lambdas - Roger Orr [ ACCU 2021 ]
1:25:42
ACCU Conference
Рет қаралды 1 М.
Lightning Talk: FizzBuzz Covered - Kevlin Henney - ACCU 2023
5:02
ACCU Conference
Рет қаралды 800
CppCon 2018: Jason Turner “Applied Best Practices”
1:03:19
Pacific++ 2018: Sean Parent "Generic Programming"
1:19:57
Pacific++
Рет қаралды 18 М.
La final estuvo difícil
00:34
Juan De Dios Pantoja
Рет қаралды 29 МЛН