Many resources discuss the best ways to learn a programming language, including:
- Reading a book or a magazine.
- Resources from web sites.
- From a colleague.
- Taking a training course.
- Exploring open source projects.
However, it is difficult to find resources that explain advanced C++ techniques using small, focused examples. If you want to improve your C++ skills, reading the standard is often recommended. However, this can be a daunting task: few developers are willing to work through a document of more than 1,500 pages.
Another approach is to study the small examples included with compiler source code. Open-source C++ compilers such as GCC and Clang implement the C++ standard. The good news is that Clang provides an extensive test suite to validate the compiler’s conformance to the standard. These examples are well implemented, easy to understand, and well commented, and they cover many C++ features.
You can explore these small examples to gain a better understanding of specific C++ features. Many test cases are available here: $LLVMPATH$\tools\clang\test. They cover many aspects of the compiler:

For C++ syntax, you can explore the examples in the SemaCXX directory, which contains many interesting test cases covering almost all C++ features, including those introduced in C++11 and C++14.

Let’s take the C-style casts in the cstyle-cast.cpp file as an example:

This test is well commented and explains the various casting cases; developers can learn a great deal by exploring it.
Summary:
Exploring the Clang test suite can help any C++ developer improve their programming skills; even C++ experts can discover new details by studying these focused examples.
