~/talk

Personal Log - Where No Init Has Gone Before in C++

Talkat CppCon 2022 · 2022-09-11..09-16· [rust]
slides:none on file

Claim: C++17 can execute uncalled local code by instantiating a template on a consteval-compatible function pointer so a compile-time hash replaces literal log text and shipped binaries contain only numeric keys. A small DO_ON_INIT utility (implemented in under 20 lines) collects those source strings at global init into a decoder mapping, enabling readable logs later while keeping vanishing strings out of releases. Prototype works on MSVC, has GCC/clang portability caveats and is shown running end-to-end against a real codebase.

AI-written summary · about

  1. 0:00Personal log exploration in C++
  2. 2:33Introduction
  3. 3:35Removing log strings from binaries
  4. 5:00Traditional logging challenges
  5. 6:03Advantages and drawbacks of hashing log strings
  6. 7:28Compile-time hashing for logs
  7. 9:16Log removal in production
  8. 10:20Decoding challenges and collaboration
  9. 12:33Static members forcing execution
  10. 15:43Linker errors with static data
  11. 16:50Static init with lambdas
  12. 18:55Function pointers in templates
  13. 20:20Macros and C++20 improvements
  14. 21:46Compiler compatibility issues
  15. 23:38Decoder tool design
  16. 27:32Debugging decoder call stacks
  17. 29:28Live demo: encoding/decoding
  18. 33:07Special technique enablers
  19. 34:53Compiler compatibility with static init
  20. 38:54Technique recap
  21. 39:57Performance and build impact
  22. 41:21Production limitations
  23. 44:07Additional static init uses
  24. 45:31Acknowledgments
  25. 45:54Q&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.