~/talk

const correctly in C++ :

Talkat Core C++ 2025 · on Sunday, 2025-10-19· [c-and-cpp]
name:Alex Cohn
links:none on file
slides:none on file

C++ const rules for pointers, members, and methods with concrete examples: pointer placement of const affects pointer vs pointee, const_cast causes undefined behavior when removing const from an originally-const object, prefer avoiding C-style casts, use const& parameters to avoid copies, and mark getters as const to enable correct polymorphism. Shows using mutable for a mutex inside a const object and demonstrates std::experimental::propagate_const (not supported on MSVC yet) to keep container-held pointers const-correct.

AI-written summary · about

  1. 0:00Introduction and speaker background
  2. 1:16What is const in C++
  3. 3:06Const with pointers explained
  4. 5:16Const with objects and classes
  5. 7:34Const methods and API contracts
  6. 9:06Dangers of const_cast misuse
  7. 13:13Mutable keyword for controlled mutability
  8. 14:48Const correctness in APIs
  9. 16:39Const and method overloading
  10. 18:26Const pointers in POSIX functions
  11. 21:22Const in STL containers
  12. 22:54Const iterators in STL
  13. 23:57Const references for performance
  14. 24:41Why const matters in legacy code
  15. 26:54Propagating const correctness
  16. 28:22Summary and best practices
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.