~/talk

Nothing is better than copy or move

Talkat ACCU 2018 · 2018-04-11..04-14· [software-architecture]
name:Roger Orr
links:none on file
slides:none on file

C++17 makes what used to be “copy elision” mandatory in many cases so temporary materialization conversions must construct objects directly with no copy or move and code that relies on side effects to detect copies is unreliable; using std::move disables NRVO and can force an extra move where none is needed; small trivially copyable structs may be passed in registers but ABIs differ; avoid unnecessary special-member functions, prefer by-value parameters when it simplifies moves, and don’t take shared_ptr by value unless ownership transfer is intended.

AI-written summary · about

  1. 0:00Intro
  2. 1:04How did we get here?
  3. 9:03How does this magic work?
  4. 16:45Early days of C++
  5. 23:22Another C++98 example...
  6. 25:01A third C++98 example...
  7. 31:33Can actually break C++03 code
  8. 36:11Temporary Materialization
  9. 42:20A simplification
  10. 43:30Don't be too clever!
  11. 45:19Another example...
  12. 46:16One bad object poisons the move
  13. 48:05Special Members
  14. 50:29What are the rules?
  15. 50:56Comparison of copy and move
  16. 56:24MSVC x86/x64 convention
  17. 58:50Passing arguments to functions
  18. 59:15Returning or passing a reference?
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.