~/talk

Fun with Flags - C++ Type-safe Bitwise Operations

Talkat C++Now 2024 · 2024-04-29..05-03· [c-and-cpp]
links:none on file
slides:none on file

Library Boost.Flags implements type-safe bitwise operators for enum-based flags by adding a complementary flag type and ADL-visible operator overloads enabled via a macro. It keeps operations non-intrusive and zero-overhead in optimized builds, prevents mixing different flag types (and rules out common UB by using underlying integer for complements), supports scoped and unscoped enums, includes helpers like subset/disjoint, and already sees ~120 uses in a 25-year codebase (Absolum) with a broad compiler/test matrix.

AI-written summary · about

  1. 0:00Introduction to bitwise flags
  2. 3:35Problems with current methods
  3. 11:53The mathematics of bit sets
  4. 25:23Library demonstration
  5. 29:53Library design and comparison
  6. 49:05Q&A and concluding remarks
~/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.