This article is intended to summarize the state of play in the upcoming C++26 Standard as regards reflection, which is where information (metadata) about the source code is made available for use at run-time, as opposed to only being available at compile-time. Proposal P2996 is the main (initial) paper for the implementation of reflection in C++, and has been voted into C++26 as of June 2025. An “experimental” branch of Clang (available on Compiler Explorer) currently implements a number of features from this paper (note that not all of the code in this article compiles at present, as syntax is in a state of flux).
Continue reading “Reflection in C++26 (P2996)”Tag: standard-library
Move Semantics in Modern C++ (1)
The title for this mini-series may seem to be ambitious for two reasons: move semantics have been available for a long time (since C++11 in fact, so not very “Modern”), and it is a large subject (there is a book by a well-regarded author devoted entirely to the topic). We’ll be introducing the subject slowly, starting with the core concepts and notation, before moving onto the interesting corner-cases. In this article we’ll begin by discussing the idea of a “movable” type and the implications for performance gains.
Continue reading “Move Semantics in Modern C++ (1)”