Hello all!
Our latest San Diego C++ Meetup took place on Tuesday, September 24th, 2025. It was another great virtual session where we dove deep into some of the lesser-known features and types in Modern C++. A massive thank you to everyone who joined, participated in the quizzes, and contributed to the discussion!
For those who couldn’t make it or wish to review the topics, the full recording is available on YouTube:
- Meeting Event Page: here
YouTube Recording:
Meeting Summary
The evening kicked off with a fun C++ quiz to warm up the brain(#360), followed by the main presentation which I titled: “C++ Esoterica: A Tour of Special Keywords & Features.”
Here is a brief overview of the C++ features we explored:
C++ Esoterica: A Tour of Special Keywords & Features
This talk was an exploration of lesser-used types, attributes, and language features that can significantly improve code safety, clarity, and expressiveness. We covered the following topics:
- std::extent [00:11:00]: A type trait used to get the number of elements in a specific dimension of a C-style array at compile time, particularly useful in template metaprogramming.
- std::valarray [00:13:00]: We looked at this container designed specifically for high-performance numerical computing and element-wise mathematical operations, noting its niche role compared to std::vector.
- The Spaceship Operator ( <=>) [00:15:00]: A discussion on how this C++20 feature simplifies object comparison by generating all relational operators from a single definition.
- std::monostate [00:17:00]: We explored this empty type from the <variant> header, primarily used to represent the “empty” or default state in a std::variant, and even showed an advanced pattern for creating custom RAII resource handles using std::monostate within a std::variant to manage a std::unique_ptr with a custom deleter.
- std::nullptr_t [00:26:00]: A reminder that this is the distinct type of the nullptr literal, which prevents the pre-C++11 ambiguity that could occur when passing NULL (often defined as ) to overloaded functions.
- std::intptr_t / std::uintptr_t [00:28:00]: We discussed these types for low-level pointer arithmetic and manipulation, emphasizing the use of the unsigned std::uintptr_t for memory addresses due to its defined wrap-around behavior.
- std::ignore [00:30:00]: The placeholder object used with std::tie to discard unwanted elements when unpacking a tuple or pair.
- std::enable_shared_from_this [00:32:00]: A crucial pattern for safely obtaining a std::shared_ptr to the current object from within its own member functions, thus preventing double deletion.
- Ranges Placeholders ( std::ranges::dangling, std::ranges::empty_view) [00:34:00]: We looked at these C++20 range components that promote safer code by preventing the use of iterators into temporary ranges ( dangling) and providing a clean, standard way to return an empty sequence ( empty_view).
- std::identity [00:38:00]: This simple C++20 function object returns its argument unchanged, making it an excellent default “projection” for generic algorithms.
- [[fallthrough]] [00:42:00]: The C++17 attribute used inside a switch statement to explicitly declare an intentional fallthrough, suppressing compiler warnings and clarifying intent.
- Experimental Features [00:44:00]: We briefly touched upon std::experimental::scoped_exit as a generalized RAII mechanism and std::experimental::propagate_const for addressing const-correctness loopholes with raw pointers inside class members.
- std::bit_cast [00:48:00]: The modern, safe C++20 way to perform type punning, reinterpreting the bit pattern of an object while avoiding the undefined behavior associated with reinterpret_cast and strict aliasing rules.
- Iterator Utilities ( std::next, std::prev, std::advance) [00:50:00]: A review of these iterator helpers, distinguishing between the “peekers” ( next/ prev) that return a new iterator, and the “mover” ( advance) that modifies the original iterator in place.
A special thanks to our sponsors:
- JetBrains for their generous and continued sponsorship of the San Diego C++ Meetup group.
- Packt for providing exclusive discount codes to our attendees for their vast library of C++ books and resources.
Thank You for reading!
Kobi.
