[Joke] C++ and D namings

Ola Fosheim Grostad ola.fosheim.grostad at gmail.com
Wed Jan 20 14:48:33 UTC 2021


On Wednesday, 20 January 2021 at 14:33:11 UTC, Steven 
Schveighoffer wrote:
> But technically, you can set one union member and as long as 
> you don't use the other, it's never UB. In this case, however, 
> it would seem fine.
>
> Your immutable case would ALWAYS be UB, but only if you 
> accessed the member you didn't set.

Where does the spec say that unions cannot be used for type 
punning?




More information about the Digitalmars-d mailing list