~/talk

The Detection Idiom - a simpler way to SFINAE

Talkat ACCU 2017 · 2017-04-24..04-29· [c-and-cpp, compilers-and-language-design]
links:none on file
slides:none on file

Explains a practical way to replace messy enable_if SFINAE with the detection idiom from the Library Fundamentals TS that uses void_t plus a hidden detector and utilities like is_detected / detected_t / detected_or. Shows concrete checks (nested type presence, size_type fallback, copy-assignment signature) implemented with decltype and declval, compiles at compile time, and simplifies many library traits; requires modern C++ (C++14-style templates) and the examples all compile as shown.

AI-written summary · about

  1. 0:00Introduction and speaker background
  2. 2:43What is the detection idiom
  3. 8:58SFINAE and overload resolution
  4. 17:18Why detection idiom matters
  5. 21:11Simple example with nested types
  6. 23:24Practical example with size_type
  7. 26:05Void T and Nonesuch explained
  8. 31:54How detection idiom works
  9. 36:23Variations on detection
  10. 41:11Detecting expressions and member functions
  11. 45:27Detecting copy assignment
  12. 49:45Detected exact and convertible
  13. 51:09Using detection in SFINAE
~/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.