C++`= default` requests a compiler-generated implementation of a comparison operator. Defaulted `operator==` and `operator<=>` compare class subobjects in a defined order: the former tests equality, and the latter determines ordering. Defaulted secondary operators such as `!=` and `<` use rewritten comparisons instead of comparing subobjects themselves.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++A function definition using = delete prohibits its use. The function still participates in overload resolution, allowing it to block unwanted calls.
Basic · C++23; repository compiler flag, production runtime not attestedC++A floating-point literal writes a numeric value directly in source code. The suffix f or F gives it type float; without a suffix it has type double, and with l or L it has type long double.
Basic · C++23; repository compiler flag, production runtime not attestedC++A fold expression combines pack elements using a binary operator. Learn the four syntax forms, how fold direction controls grouping, and the empty-pack rules through a small summation example with an initial value.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++An integer literal writes a value directly in code. Its base, value, and optional suffix determine its type; for `ULL`, `unsigned long long` is the only standard candidate.
Basic · C++23; repository compiler flag, production runtime not attestedC++A lambda expression creates a callable object. Learn capture by copy and reference, init-capture, the meaning of mutable, and generic lambdas with auto parameters.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++A namespace alias gives an existing namespace an additional, usually shorter name. It does not copy the namespace's members: both names refer to the same namespace.
Basic · C++23; repository compiler flag, production runtime not attestedC++A non-type template parameter (NTTP) represents a value rather than a type. It lets you establish properties such as a buffer's size at compile time instead of passing them as function arguments.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++An operator function declaration gives a function a name consisting of operator followed by an overloadable operator designation, such as operator+. It defines how an operator works for user-defined types without changing its precedence or associativity.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++A parameter pack accepts zero or more arguments. A pack expansion applies a pattern to successive elements using `...`. Distinguish declaring a pack, expanding it, and counting its elements with `sizeof...`.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++A structured binding names elements of an array or a suitable class object. The declaration form alone does not determine whether writing through a binding changes an original element: when plain `auto` copies a `std::tuple<int&, int&>`, the bindings still refer to the same integers.
Basic · C++23; repository compiler flag, production runtime not attestedC++Template specialization supplies a different definition for specific arguments or a family of arguments. Learn the difference between full specialization with template<> and partial specialization, such as for T*, and the restrictions on function templates.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++A trailing return type places the function's result type after the parameter list, following ->. It can specify the result explicitly and can refer to parameter names in a type expression such as decltype(a + b).
Intermediate · C++23; repository compiler flag, production runtime not attestedC++A using declaration makes a selected name available in the current scope. It can shorten references to namespace names and restore base-class overloads hidden by a declaration in a derived class.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++Value initialization zero-initializes scalars, works element by element for arrays, and combines conditional zero-initialization with default-initialization for classes. It does not mean that every object will contain only zero values.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++A trailing ... in a parameter list accepts additional arguments without declared parameter types. The function reads them through <cstdarg>, relying on an agreed count and types; mistakes in that contract can cause undefined behavior.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++bool is a built-in C++ type with two values: false and true. It stores logical states. Converting a number to bool tests whether the number is nonzero, not whether it equals 1.
Basic · C++23; repository compiler flag, production runtime not attestedC++char is an integral character type occupying exactly one C++ byte. It is distinct from signed char and unsigned char, and its signedness is implementation-defined. A single char value does not necessarily represent a complete text character.
Basic · C++23; repository compiler flag, production runtime not attestedC++char16_t is a built-in integral type intended to hold UTF-16 code units. One value does not necessarily represent an entire Unicode character: some code points require a pair of code units.
Basic · C++23; repository compiler flag, production runtime not attestedC++char32_t is a built-in, distinct integer type used for UTF-32 code units. The U prefix creates the corresponding character and string literals. The type provides at least 32 value bits, but does not itself validate Unicode or guarantee a size of four bytes.
Basic · C++23; repository compiler flag, production runtime not attestedC++char8_t is a distinct integral type intended for UTF-8 code units, not an alias of unsigned char. The u8 literal prefix produces data of this type, but one code unit does not necessarily represent a complete Unicode character.
Basic · C++23; repository compiler flag, production runtime not attestedC++double is a standard floating-point type with at least as much precision as float. It stores values with fractional parts, but its precision is finite and it does not guarantee an exact representation of every decimal number.
Basic · C++23; repository compiler flag, production runtime not attestedC++float is a built-in floating-point type for storing approximate numeric values. Literals with an f or F suffix have type float, whereas unsuffixed floating-point literals have type double. C++ does not guarantee that float uses IEEE 754 or occupies 32 bits.
Basic · C++23; repository compiler flag, production runtime not attestedC++int is a built-in signed integer type that stores negative numbers, zero, and positive numbers. Its width is at least 16 bits; do not assume it is always 32 bits. Dividing two int values produces an integer result, and signed arithmetic overflow causes undefined behavior.
Basic · C++23; repository compiler flag, production runtime not attested