mercredi 1 décembre 2021

How to make a type T that `std::is_empty_v

I came across an interesting quiz question at here:

Write a translation unit containing a class type T, such that std::is_empty_v<T> is true, and yet sizeof(T) is greater than 1.

I'v thought about it for some time, but no solution.

How to make a type T that std::is_empty_v<T> && sizeof(T) > 1 is true?

Aucun commentaire:

Enregistrer un commentaire