EBO is a compiler optimization technique. In C++, even an empty struct (one with no data members) must have a size of at least 1 byte to ensure it has a unique address in memory.
However, if that empty struct is used as a base class, the compiler is allowed to optimize that space away to 0 bytes. This is critical for high-performance libraries that use many "tag" types or "stateless" functors, as it prevents memory bloat.
An Aggregate is a specific kind of class or struct in C++ that is "simple" enough to be initialized directly with braces {}.
To be an aggregate, a type generally must have:
Why it matters: Aggregates allow for Aggregate Initialization, which is often faster and allows for cleaner syntax than defining complex constructors.
Introduced in C++20, a Structural Type is a class type that can be used as a Non-Type Template Parameter (NTTP).
Previously, template parameters were limited to integers or pointers. Now, you can pass complex objects (like a fixed-size vector or a tuple) as a template argument, provided the type is "Structural" (roughly: public members, no complex copying logic).
The Tuple Protocol is a set of standardized "hooks" in the C++ Standard Library. By implementing these hooks for your custom class, you tell the compiler: "Treat my class like a tuple."
To satisfy the protocol, a type T must specialize:
Why is this useful? It enables Structured Bindings, allowing users to unpack your custom types easily
This serves as a manual reflection mechanism, as C++ (prior to C++26) lacks a proper reflection mechanism to inspect structures, these functions specifications are giving the necessary informations to the compiler in order to natively adapt your structure to be a tuple.
In C++ containers are structures built in order to store data. There can be different kinds of containers such as dynamic containers (ex : std::vector), there are also static containers (ex: std::array) or associative ones (ex: std::set). These types are often focusing on storing homogeneous data, and some of them have properties ressembling product types, namely static contiguous containers.