The tricky part is when you have empty structs. Compiler doesn't have to generate any actual mov assembly for empty structs. But when you sizeof() an empty struct, it must be 1 according to the standard.
-
-
Näytä tämä ketju
-
I haven't tested enough, but it seems that for other cases (ie, non-empty structs) it works out okay.
Näytä tämä ketju -
Perhaps the giveaway to the lack of guarantee is that the compiler will automatically generate operator=(), but not operator==().
Näytä tämä ketju
Keskustelun loppu
Uusi keskustelu -
-
-
That's kind of odd
Kiitos. Käytämme tätä aikajanasi parantamiseen. KumoaKumoa
-
-
-
Padding bytes are one (maybe the only one) reason I can think of why trivially copyable does not imply trivially comparable and why trivially comparable is not a term in C++.
-
Empty struct (1byte) is another. I haven’t tested padded bytes yet.
Keskustelun loppu
Uusi keskustelu -
Lataaminen näyttää kestävän hetken.
Twitter saattaa olla ruuhkautunut tai ongelma on muuten hetkellinen. Yritä uudelleen tai käy Twitterin tilasivulla saadaksesi lisätietoja.