World Congress 2023 • Aug 11, 2023

C++ Features You Might Not Know

Jonathan Müller

Did you know using the unary plus operator forces lambda conversions? Discover terrifying syntactic anomalies like array index commutativity. Understand these hidden edge cases to master C++ mechanics.

Pause
Mute Enter Fullscreen
#1 about 1 min

Commutative property of array indexing operators

Pointer arithmetic definitions allow basic array indices to be evaluated commutatively.

#2 about 2 min

Unary plus for integral promotion and lambda conversions

Prefixing variables with unary plus operators forces underlying numeric integral promotion and transforms capturing lambdas into regular function pointers.

#3 about 2 min

Processing parameter packs using the comma operator

The comma operator sequences code execution chronologically and enables efficient parameter pack iteration through specialized fold expressions.

#4 about 1 min

The underlying syntax structure of else-if blocks

Chaining conditional statements together technically relies entirely on evaluating nested control blocks instead of using a dedicated else-if language syntax.

#5 about 4 min

Hidden mechanics of switch statements and local scope

Placing hidden statements safely before switch labels enables local scope instantiation while custom macros efficiently validate missed default case paths.

#6 about 2 min

Manipulating floating point exceptions and nan boxing payloads

Accessing hardware division flags enables runtime mathematical state checks while manipulating unused bits opens space for creating customized boxed memory structures.

#7 about 2 min

Arbitrary ordering of declaration specifier sequences

Reordering type specifiers arbitrarily alongside implicitly initialized function variables remains perfectly permissible under the compiler's flexible syntax evaluation rules.

#8 about 1 min

Catching constructor exceptions using function try blocks

Moving error-handling catch statements completely outside the class initialization body provides functionality to explicitly trap exceptions thrown during early class construction.

#9 about 2 min

Optimizing dynamically sized vectors with the valarray container

The valarray type handles raw mathematical arithmetic more efficiently by intelligently applying built-in compiler non-aliasing assumptions via execution expression templates.

#10 about 2 min

Casts to void pointers for finding derived addresses

Utilizing a dynamic hierarchy downcast converting entirely to a single void pointer correctly queries the target memory address pointing to the most derived layout object.

#11 about 3 min

Sharing memory safely via the common initial sequence

Defining identically formatted structure payload components directly at the start of multiple given union elements ensures completely safe retrieval access to underlying tag byte representations.

#12 about 3 min

Undefined behavior edge cases in modular integer arithmetic

Standard mathematical modulo operations trigger deeply surprising integer hardware overflows when specific execution limits encounter invisible internal fraction cycles.

#13 about 3 min

Exploiting operator precedence conflicts in size computations

Compiler unary operator parsing strictly evaluates before string array index operations thereby yielding solely array character sizes instead of evaluating final specific data lookups.

Matching moments

1:04 min

Evaluating the true impact of bad JavaScript features

Peter Kröner Peter Kröner · World Congress 2025

3:32 min

Clarifying best practice patterns during structural syntax tool discussions

Jens Claes · World Congress 2023

1:36 min

Introduction to programming language internal workings

Aleksandra Sikora · World Congress 2023

13:57 min

History of C++ technical debt and language design

Stefan Baumgartner · LIVE

3:54 min

Introducing five core strengths of the programming language

Andreas Fertig · World Congress 2021

4:22 min

Managing compilation performance and implementation specifics of advanced typing

Peter Kröner Peter Kröner · World Congress 2022