~/talk

TMI on UDLs: Mechanics, Uses, and Abuses of User-Defined Literals

Talkat CppCon 2019 · 2019-09-15..09-20· [compilers-and-language-design]
links:none on file
slides:none on file

Explains all six UDL kinds, shows cooked literals versus raw literal operator parsing, and demonstrates a literal operator template that gets the character pack so dates can be syntactically validated at compile time, long numeric literals (128/256-bit) can be parsed reliably, and octal/binary surprises avoided. Covers integer/float/char/string signatures, currency literals using long double, namespace-hiding of UDLs in the std style, and enable_if/trailing-return overloads to pick behaviors; examples compile and run as constant expressions.

AI-written summary · about

  1. 0:00Introduction to UDLs
  2. 1:54Solving date type problems
  3. 3:40Why use user-defined literals
  4. 5:51Gotchas with UDL arguments
  5. 7:14Representing money safely
  6. 10:45Cooked vs raw literal operators
  7. 13:55Custom suffixes for clarity
  8. 15:21Date literals and pitfalls
  9. 17:12Raw literal operator templates
  10. 22:36Literal operator template benefits
  11. 24:44Why prefer template operators
  12. 27:53Google’s UDL concerns
  13. 29:38Conditional UDL compilation
  14. 31:25Summary and Q&A
~/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.