Šimon Tóth’s Post

View profile for Šimon Tóth

C++ Educational Content Creator | 20 years of Software Engineering experience distilled into digestible daily posts

C++20 introduced the [[no_unique_address]] attribute that can be used to annotate non-static data members. The attribute allows the compiler to optimize empty members marked with this attribute to take up no space. Compiler Explorer link: https://lnkd.in/e9betqn4 #cpp #cplusplus #coding #programming #dailybiteofcpp

  • text
Sayan Bhattacharjee

SUKRA HELITEK INC9K followers

2y

Where would this be useful? Most likely they have plans to use this in future to build more advanced features, but I can't understand how.

Like
Reply
Rafael Amizes

Biologix649 followers

2y

The compiler should be smart enough to perform this (small) optimization automatically. There is no need to introduce another attribute in an already overly bloated programming language for such a small optimization.

See more comments

To view or add a comment, sign in

Explore content categories