On Saturday, May 20, 2017 3:05:44 PM PDT Stefan Koch via Digitalmars-d wrote: > On Saturday, 20 May 2017 at 14:59:37 UTC, Ola Fosheim Grøstad > > wrote: > > On Saturday, 20 May 2017 at 13:36:14 UTC, Stefan Koch wrote: > >> unions and other ABI-related things will be tricky. > > > > Isn't the unions issue quite easily solved by tagging behind > > the scenes? > > Ah tagging behind the scene is an option, it comes with runtime > cost though. > And tagging would disallow the tricky and very common usecase of > overlaying and int and a float. > > This I understand, is heavily used.
std.bitmanip definitely uses that sort of trick (it also does it between a static array of ubytes) and integer types for stuff like swapping endianness). - Jonathan M Davis