C++20: The Unspoken Features

The article on C++20 features that you probably haven't heard of. Highly recommended!:)

https://humanreadablemag.com/issues/3/articles/cpp20-the-unspoken-features
I had heard about most of them but interesting features nevertheless.

Some mistakes/omissions:

Designated Initializers - You probably don't mean "default initialization" because that would imply types without a user-defined constructor, such as int, are left uninitialized which I don't think is what happens.

Spaceship Operator - A user-defined spaceship operator only generates <, >, <= and >=. If you want == and != you need to also provide a user-defined == operator.

consteval and constinit Keywords - consteval is only good for forcing compile-time evaluation if you don't want the function to be callable with runtime values. constinit is mainly a tool to avoid the static initialization order fiasco. It cannot be used on local variables.
Topic archived. No new replies allowed.