Tag: C++ 20

C++20 [[no_unique_address]] Attribute

Written by on June 26, 2022 in C++, Programming with 0 Comments
C++20 [[no_unique_address]] Attribute

The [[no_unique_address]] attribute was introduced in C++20 to give a compiler the freedom to optimise memory allocation of a struct/class when it contains a subobject that does not have any members. The other requirement is that the subobject should not be a static member of the enclosing struct/class. Let us start with the basics first. […]

Continue Reading

C++ 20: Concepts

Written by on September 19, 2021 in C++, Programming with 0 Comments
C++ 20: Concepts

Concepts, introduced in C++20, are predicates that act as contraints on template parameters. As you would expect, the nice thing is that the constraint checking happens as part of template instantiation at compile time and not at run time! Since templates can have type as well as non-type parameters, Concepts can be applied to both […]

Continue Reading

Top