~/talk

Custom Overload Sets and Inline SFINAE for Truly Generic Interfaces

Talkat CppCon 2018 · 2018-09-23..09-28· [c-and-cpp, compilers-and-language-design]
links:none on file
slides:none on file

Shows how C++17 features (void_t, template deduction guides, invoke, constexpr if, decltype(auto) on lambdas) let code pick the first compilable option, pick the best overload, or test validity of expressions without heavy boilerplate. Builds a validator/is_valid utility that makes inline SFINAE work via lambda return-type deduction, an overload_sequence that chooses the first callable that compiles (demonstrated with element_count selecting size, distance, or 1), and a type_selector that picks the first type making expressions valid. Works on Clang; deduction-guide trick currently breaks on some GCC cases; overload_set can’t handle final classes or unions yet.

AI-written summary · about

  1. 0:00Introduction and motivation
  2. 7:43SFINAE limitations and challenges
  3. 13:53Inline SFINAE with lambdas
  4. 23:53Overload sequences for ranked calls
  5. 31:51Overload sets for best match
  6. 42:15Understanding callable types
  7. 48:53Type selection with expressions
  8. 51:56Summary and conclusions
~/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.