Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.std.c++ > #702

Re: Is a union a kind of class?

Message-ID <l9rv67$ll6$1@dont-email.me> (permalink)
Newsgroups comp.std.c++
From James Kuyper <jameskuyper@verizon.net>
Subject Re: Is a union a kind of class?
Organization A noiseless patient Spider
References <52204496.5050408@bawi.org> <24874a99-32a8-475d-88c2-36631dfb45ba@googlegroups.com> <c8rtu.34611$O25.31034@fx21.iad> <52B84DE2.2070604@verizon.net> <f9355f69-7099-433e-9337-e5558381e238@googlegroups.com>
Date 2013-12-31 17:45 -0600

Show all headers | View raw


On 12/30/2013 12:00 AM, evansl wrote:
>
> On Friday, December 27, 2013 1:11:16 PM UTC-6, James Kuyper wrote:
...
>> Not necessarily. The minimum possible size will be sizeof(double) +
>> alignof(double), which could be smaller than 2*sizeof(double)
...
>> - in principle, it could be as small as sizeof(double) + 1.
>
> I don't understand, unless alignof(double) == 1;

Correct - alignof(double) == 1 is precisely the possibility (and it is
indeed a possibility) that I was referring to.

> Could you explain a little more about this "in principle" statement?

Implementations where alignof(double)==1 are rare; possibly non-existent
- at least, I can't vouch for the existence of any such implementation.
However, if such an implementation did exist, the fact that
alignof(double)==1 would not prevent it from fully conforming to the C
standard. That's what I mean by "in principle".
--
James Kuyper


[ comp.std.c++ is moderated.  To submit articles, try posting with your ]
[ newsreader.  If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]

Back to comp.std.c++ | Previous | NextPrevious in thread | Find similar


Thread

Is a union a kind of class? Seungbeom Kim <musiphil@bawi.org> - 2013-08-31 01:12 -0600
  Re: Is a union a kind of class? Daniel Krügler <daniel.kruegler@googlemail.com> - 2013-08-31 23:52 -0700
  Re: Is a union a kind of class? James Kuyper <jameskuyper@verizon.net> - 2013-08-31 23:52 -0700
  Re: Is a union a kind of class? johnolithicsoftware@googlemail.com - 2013-12-19 11:24 -0800
    Re: Is a union a kind of class? "news" <news@fx21.iad.highwinds-media.com> - 2013-12-22 19:27 -0600
      Re: Is a union a kind of class? James Kuyper <jameskuyper@verizon.net> - 2013-12-27 13:11 -0600
        Re: Is a union a kind of class? evansl <cppljevans@googlemail.com> - 2013-12-29 23:00 -0600
          Re: Is a union a kind of class? James Kuyper <jameskuyper@verizon.net> - 2013-12-31 17:45 -0600

csiph-web