Tag: compile-time
9 posts
-
C++26 Reflection Basics: the ^^ Operator, std::meta::info and template for
The actual syntax of C++26 static reflection (P2996): the ^^ operator and std::meta::info, identifier_of, nonstatic_data_members_of with access_context, [: :] splices, template for with define_static_array, [[=...]] annotations, compiler support, and C++20 alternatives.
-
C++17 constexpr Lambdas: Implicit constexpr, Captures, and Limits
How C++17 constexpr lambdas work: when a lambda is implicitly constexpr, capture rules for constant evaluation, real GCC errors, and C++20 changes.
-
Tag Dispatching in C++: Overload Selection by Tag Types, vs if constexpr and Concepts
How tag dispatching picks a C++ overload at compile time with empty tag types, why iterator tags inherit from each other, and when if constexpr fits better.
-
C++20 Modules: export/import, Partitions and Building with GCC, Clang, MSVC and CMake
C++20 modules: export/import, partitions, global fragments, GCC/Clang/MSVC, CMake 3.28+—parse once, reuse BMIs, faster builds than plain headers.
-
C++ constexpr Functions and Variables: Compute at Compile
Compute values at compile time with constexpr: C++14/20 rule changes, constexpr vs const, a CRC32 lookup table, and fixes for ten common constexpr errors.
-
C++ `if constexpr` | Compile-Time Branching in Templates
Use `if constexpr` to discard untaken branches during instantiation—unlike runtime `if`, avoiding ill-formed code in unused branches for templates.
-
Moving Work to Compile Time in C++: constexpr, consteval, if constexpr and TMP
Move work into the C++ compiler with constexpr functions and classes, consteval for mandatory compile-time calls, if constexpr, and template metaprogramming.
-
C++ constexpr Functions: Compile-Time Evaluation Rules from C++11 to C++17
C++ constexpr functions: compile-time and runtime use, C++11 vs C++14 vs C++17, arrays, classes, and optimization. Practical examples and pitfalls.
-
C++20 consteval: Forcing Compile-Time Evaluation Where constexpr Only Allows It
C++20 consteval explained: immediate functions vs constexpr, why a constexpr wrapper cannot pass its parameter, if consteval, C++23 propagation, and real diagnostics.