~/lightning

'Meaningful' casts

Lightningat Meeting C++ 2015 · 2015-12-04..12-05· [rust]
slides:none on file

Implements concrete safer casts: to_num that checks overflow by promoting operands and using fenv/CFM checks, from_enum/to_enum that use std::underlying_type and enable_if to forbid invalid enum/number conversions, storage_cast that static_asserts size and alignment and copies CV qualifiers, and to_base/to_derived that tag-dispatches on std::is_polymorphic and uses dynamic_cast to assert correctness at runtime. Examples trigger compile errors or runtime assertions on overflow/mistyped enums and misaligned storage; points to Boost.NumericCast and Boost.polymorphic_cast and recommends compiler sanitizers (GCC/Clang) for production use.

AI-written summary · about

  1. 0:00Wrapping static casts
  2. 3:24Converting enums
  3. 6:43Storage cast
  4. 9:39Nonpolymorphic casts
~/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.