~/talk

A Conversion Story: Improving from_chars and to_chars in C++17

Talkat CppCon 2019 · 2019-09-15..09-20· [c-and-cpp]
links:none on file
slides:none on file

Provides tiny wrapper templates that eliminate the end pointer by taking arrays by reference or containers with contiguous storage and calling std::from_chars/std::to_chars, so callers pass a string, array, string_view or vector without computing length. Code remains one-line thin wrappers that preserve from_chars semantics (no hidden allocation, no implicit null termination), explicitly rejects bool conversions and notes a compiler bug tracked as LWG 3266. Also suggests optional preallocation to avoid repeated growth.

AI-written summary · about

  1. 0:00Introduction
  2. 0:36What is a conversion
  3. 0:47Conversion functions
  4. 3:01Floating point types
  5. 3:16Usage
  6. 3:53Making it better
  7. 4:11What if
  8. 4:47Array
  9. 5:50Utility header
  10. 6:29Helpers
  11. 6:40Integers
  12. 7:19Containers
  13. 7:29Floating
~/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.