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 Are The Elementary String Conversions That Come With C++ 17?

In addition to many beneficial features of C++ 17, there are elementary string conversions introduced in that specification. The std::to_chars() and std::from_chars() are defined in <charconv> header to do conversions between numeric values to strings or strings to numeric values without considering locale-specific conversions. In this post, we explain the std::to_chars() and std::from_chars()…
Read more
C++C++11C++14C++17Introduction to C++Learn C++

Everything You Need To Know About The Copy Assignment Operator In C++ Classes

Classes and Objects are part of object-oriented methods and typically provide features such as properties and methods. One of the great features of an object orientated language like C++ is a copy assignment operator that is used with operator= to create a new object from an existing one. In this post, we explain what a copy assignment operator is and its types in usage with some C++…
Read more
C++C++17C++20Introduction to C++Learn C++Syntax

What Is Std::any In C++ 17 And How We Can Use It?

C++17 standard is amazing with a lot of new features, and one of the interesting features was the new type std::any. std::any is a type-safe container to store a single value of any variable type. In this post, we explain std::any in modern C++. What is std::any in C++ 17 ? The any class (std::any) is a new class defined in the <any> header in C++17 and it is used for any type…
Read more