C++C++17C++20Learn C++SyntaxTemplates

How To Use void_t Alias Template in C++ 17?

In C++ 17, there is a very useful alias template for metaprogramming that can be used to simplify use of SFINAE. The void_tis a meta-function that is used to map any types ( or types) to typevoid. In this post, we explain what is void_t, how you can use it in different examples. What is alias template void_t in C++ 17? The void_t is an alias template which is introduced with…
Read more
C++C++17Learn C++Syntax

What Is The New std::sample Algorithm In C++ 17?

The C++ 17 standard bring us a lot of useful methods, templates and algorithms. One of the great algorithms is std::sample defined in the <algorithm> header that samples at most n elements uniformly from a given range. In this post, we explain the std::sample algorithm and how we can use it with an mt19937 random generator. What is the std::sample algorithm in C++ 17 and beyond? The…
Read more
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++17C++20IteratorsLearn C++Syntax

What Are The New Algorithms That Come With C++ 17?

The C++17 standard came with a lot of new features and improvements. One of the features was the math.h library which modernized math operations with the cmath library. The Parallelism Technical Specification adds several new algorithms to the standard C++ library that we can use in C++ Builder 12. These are modernized in the <algorithm> header in the standard library. In this post, we…
Read more