A tour of C++ recognised user type categories

By Nina Ranns

What’s trivial about trivial types ? What can we say about the layout of the standard layout types? What is the lifetime of an implicit-lifetime type ? How are all these types different from aggregate types, literal types, and structural types? Why do we need them, and when do we care ? Everything you wanted to know about C++ user type categories and more.

Modern C++ offers several new classification of user defined types that are in certain contexts treated like built-in types. Getting familiar with them will allow you to take advantage of the special provisions the language gives you and write better code. Knowing the boundaries of those specific situations will prevent you from falling into the UB abyss. Join me as we take a tour of language recognised user types, noting their advantages and pitfalls.

Your Privacy

By clicking "Accept All Cookies" you agree ACCU can store cookies on your device and disclose information in accordance with our Privacy Policy and Cookie Policy.

By clicking "Share IP Address" you agree ACCU can forward your IP address to third-party sites to enhance the information presented on the site, and that these sites may store cookies on your device.