3 ms·
It has other uses for end-user developers. For example, when you need a class member to be conditionally elided based on template parameters. You can swap the n
by jandrewrogers 2y ago
It has other uses for end-user developers. For example, when you need a class member to be conditionally elided based on template parameters. You can swap the normal type with non-zero size with std::monostate such that it has zero size.
- tpolzer 2y agoA std::monostate member will still have non zero size, because it needs a unique address. See https://en.cppreference.com/w/cpp/language/ebo https://en.cppreference.com/w/cpp/language/ebo
- jandrewrogers 2y ago...except if you use the standard [[no_unique_address]] attribute.