This repository contains a collection of small, self-contained C++ examples organized by language standard.
Each example demonstrates a specific feature, such as the Rule of Five (C++11), if constexpr (C++17), or Concepts (C++20).
The goal is to provide minimal, compilable examples that can be used as a reference or starting point when learning modern C++.
Each file has been included in the CMakeLists fo
cmake -S . -B build
cmake --build buildTo build only a single example, specify the target:
cmake --build build --target rule_of_fiveThe compiled executables are placed in the corresponding build subfolders:
./build/C++11/rule_of_five
./build/C++17/structured_bindings
./build/C++20/importsIf CTest is enabled, all examples can be registerd as test and run with:
cd build
ctest --output-on-failureThis project is licensed under the MIT License (i.e. free to use, modify and share the code for learning and teaching)