~/lightning

Lightning Talk: So You Thought C++ Was Weird? Meet Enums

Lightningat CppCon 2021 · on Sunday, 2021-10-24· [c-and-cpp]
slides:none on file

C++ enums are just named integers so they are not a closed set: before C++17 the underlying storage is unspecified and even after it can hold any bit pattern that fits, so casting ints can produce enumerator-less values and MSVC is correct to demand exhaustiveness. The talk demonstrates surprising concrete examples (casting 3 into a 0..2 enum, using int storage, MSVC warnings) and suggests using libraries like battery num or wise enum (noting wise enum had MSVC issues).

AI-written summary · about

  1. 0:00Intro
  2. 0:26Enums
  3. 0:41Booleans
  4. 0:54Swift
  5. 1:06Noms
  6. 1:20Switch Cases
  7. 1:38Use a Library
  8. 1:58Weird Error
  9. 2:35Enum Storage
  10. 3:28Visual Studio
  11. 4:22Enums are not closed values
~/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.