Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.lang.c++ Subject: Re: Union type punning in C++ Date: Tue, 14 Jan 2020 07:05:25 -0800 Organization: A noiseless patient Spider Lines: 11 Message-ID: <86muaqgjt6.fsf@linuxsc.com> References: <868sme2err.fsf@linuxsc.com> <86v9pfguqn.fsf@linuxsc.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="2dd0ff26386f9ade01e1210d85a64307"; logging-data="25738"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+jNMO8NxCV3w/jbL9IWTEsMU7WgqkWBqI=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:4cIhKwB6+d0ixFwUBqjYCaaym1Y= sha1:EaXtvGYRYq7H7czBV0jJQ3Ga2QU= Xref: csiph.com comp.lang.c++:71338 "Chris M. Thomasson" writes: [...] > I added in the extraneous base in the union out of some sort of > reflex mixed with trying to just read from o.b. Maybe you were thinking of programming in C. In C there is often benefit to have a "stub" type that serves mainly to differentiate the "concrete" types. AFAICT in C++ there is not, except perhaps as some sort of aid to the reader.