~/talk

StringViews, StringViews everywhere!

Talkat Meeting C++ 2017 · 2017-11-09..11-11· [rust]
name:Marc Mutz
links:none on file
slides:none on file

Explains why std::string_view and QStringView make non-owning string APIs practical, shows concrete code that replaces std::string params to avoid heap allocations and how to implement heterogeneous lookup for unordered maps so lookups of literals and string_views are no allocations. Demonstrates node extraction to fix SSO-related pointer issues, delegates member calls to free functions for register passing, documents lifetime pitfalls when returning views, and reports partial Qt 5.10 rollout with measurable allocation savings in XML entity lookup.

AI-written summary · about

  1. 0:00Start
  2. 4:02string_view as an interface Type
  3. 12:00Heterogeneous Associative Container Lookup
  4. 14:14Ordered STL containers have heterogeneous lookup
  5. 15:45Can we do better?
  6. 30:08Marrying Member Functions and Free Functions
  7. 33:06but need to mirror std::string API!
  8. 35:36Contracts && String-Views
  9. 40:08What about "valid parameter values"?
  10. 45:58Where's the difference?
  11. 47:00What if you could check (ptr, len) is a valid range?
  12. 48:18Thank you for your attention! Questions?
~/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.