C++C++11C++14C++17C++20Learn C++

How To Use Alias Templates For Traits In C++ 17 and Beyond

One of the great features of C++ is templates, they are parameterized by alias templates in C++11. Then, In C++14 and C++17, they improved C++11’s feature with a number of template aliases whose use simplifies the traits. This feature is called “Alias Templates For Traits” and in this post, we explain what is and alias template and how we can use alias templates with…
Read more
C++C++11C++14C++17Learn C++SyntaxTemplates

Learn About Extern Templates In Modern C++

The template feature in C++ is one of the great capabilities of modern C++. A template is a simple and very powerful statement in C++ that defines the operations of a class or function. In this article, we will show how extern templates can be used in a modern C++ app based on recent C++ standards.  First of all, let’s remind ourselves of what templates are in C++. What is a…
Read more
C++C++11C++14C++17Learn C++Templates

Learn How To Eliminate Pointers In Templates in C++

The C++ language is a very rich and flexible programming language packed full of features designed to help you create modern, robust applications of all types. One of the great features of modern C++ is templates. In some cases, we need to eliminate pointers in templates. In this article, we will explain how to eliminate pointers in templates with C++ examples that can be used in any C++…
Read more
C++11C++14C++17Learn C++Templates

Stages of C++ Templates Compilation On Windows

In order to compile C++ templates the compilers like Embarcadero RAD Studio C++ compilers are required to perform two stages: definition stage and instantiation stage. The template definition stage On this stage the following checks are performed: static assertions and availability of names declarations (such as names of classes and functions) independent on template parameters are…
Read more