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

What Are Delegating Constructors In Modern C++?

C++11 introduces the possibility of Delegating Constructors (aka Constructor Delegation) that can be used by C++ in 2023. In the Constructor Delegation feature, class constructors can be invoked within other constructors of the same class. This is a very useful feature that helps programmers to write less and more expressive code. Constructor Delegation reduce the repetitive code by adding a…
Read more
C++C++11C++14C++17C++20Learn C++Syntax

How To Use std::align In Modern C++

The C++11 standard introduced alignment support as one of the many features of a Modern compiler for the C++ programming language. One of the new features of this support is a new keyword align std::align which is used to get a pointer aligned by the specifiedalignmentfora sizein bytes in consider with size of the buffer. In this post, we explain how we can use align in…
Read more
C++C++11C++14C++17Learn C++

What Is The alignas Alignment Specifier In Modern C++?

One of the features of Modern C++ is Alignment Support which comes with the C++11 standard. One of the new features of this support is a new keyword alignas which is the alignment specifier. For example, we can apply the alignas alignment specifier to define the minimum block size of data types such as the size of structs. In this post, we explain how we can use alignas in Modern C++ . What…
Read more
C++C++11C++14C++17Introduction to C++Learn C++

How To Learn initializer_list (std::initializer_list) In Modern C++

C++ has some really great features for being able to define different types of variables and structure. One of the most used and very useful arrays in C++ is the std::vector. If you know arrays in C and C++, then containers are a modern and very flexible form of arrays in C++. If you want to initialize containers like vector, list, map, etc. you need use std::initializer_list. It can be used with…
Read more