~/talk

To Pass and Return — The Story of Functions, Values and Compilers

Talkat C++ on Sea 2022 · 2022-07-05..07-07· [compilers-and-language-design]
links:none on file
slides:none on file

Explains that C++17 makes copy elision mandated in C++17 for returned temporaries but real compilers differ: GCC/Clang eliminate copies for trivial and many complex cases, often inlining and creating return objects directly in caller storage; oversized objects use a caller-allocated buffer and pointers are passed in registers or on the stack. Intel (icc) and MSVC sometimes emit extra temporaries and perform one or two copy/move constructions — MSVC notably constructs a temporary and then copies it into the result in the shown examples — while GCC/Clang can even partially remove non‑trivial moves.

AI-written summary · about

  1. 0:00Start
  2. 5:36Takeaways
  3. 10:47Oversized Object
  4. 14:07Returning by Value
  5. 19:58The Return Value Optimization
  6. 21:27Return Value Optimization
  7. 23:02Delay Temporary Materialization
  8. 25:31Random Condition
  9. 25:58Return Statements
  10. 28:10Msvcd
  11. 46:50Summary
  12. 47:28Answers
~/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.