~/talk

“Making New Friends”

Talkat CppCon 2018 · 2018-09-23..09-28
slides:none on file

Shows a concrete technique: put non-member operator definitions inside a class template as friend functions so each instantiation manufactures its own friend, avoiding huge numbers of overload templates and restoring implicit conversions that template argument deduction would otherwise block. Demonstrates with a templated rational type, reproduces mean/median examples, traces compiler diagnostics across GCC/MSVC, explains the in situ definition trick and how argument-dependent lookup locates the generated operators.

AI-written summary · about

  1. 0:00Introduction to friendship
  2. 1:03What is friendship in C++
  3. 8:03Friendship for operator overloading
  4. 16:36Rational number class example
  5. 21:00Rational class as a template
  6. 27:22Template conversion issues
  7. 31:29Compiler compatibility problems
  8. 40:28Making new friends idiom
  9. 47:01In situ friend definitions
  10. 52:55Fixing template conversion issues
  11. 58:13Friendship to deny membership
  12. 1:00:20Summary and references
~/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.