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++14C++17C++20Learn C++Syntax

What Is std::quoted Quoted String In Modern C++?

Sometimes we want to preserve the string format especially when we use string in a string with /”. In C++14 and above, there is a std::quoted template that allows handling strings safely where they may contain spaces and special characters and it keeps their formatting intact. In this post, we explain std::quoted quoted strings in modern C++. What Is Quoted String In Modern…
Read more
C++C++11C++14C++17Learn C++Syntax

What Is An Extended Friend Declaration in Modern C++?

In modern C++ the standards have a wonderfully named extended friend declaration feature to address the class declarations which is a template parameter as a friend. This extended friend declaration is available with the C++ compiler that has C++11 and above standards. In this post, we explain a friend and extended friend declaration in modern C++. What is a friend declaration in modern…
Read more
C++C++11C++14C++17C++20Learn C++Syntax

What Is A Trivial Move Constructor In Modern C++?

C++ is a wonderful programming language with its object-oriented programming features, such as Classes, Objects, constructors, move constructors, copy constructors, destructors, etc. Since the C++11 standards, in modern C++, one of the features is the move constructor that allows you to move the resources from one object to another object without copying them. One of the move constructors is the…
Read more