Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.c++.moderated    |    Moderated discussion of C++ superhackery    |    33,346 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 32,243 of 33,346    |
|    Seungbeom Kim to cartec69@gmail.com    |
|    Re: Most-derived objects objects shall h    |
|    04 May 12 17:37:18    |
      eeda2344       From: musiphil@bawi.org              On 2012-05-04 15:15, cartec69@gmail.com wrote:       >       > There is no contradiction if sizeof(*new int[0]) != 0, [...]              'new int[n]' "yields a pointer to the initial element (if any) of the       array" (5.3.4/5), not a pointer to the entire array, so '*new int[n]' just       designates an int object, and sizeof(*new int[n]) is always sizeof(int).       There's no way to apply sizeof to a dynamically allocated array object.              It is interesting that 5.3.4/5 writes "(if any)", as if it took zero-length       arrays into account, and a footnote in 5.3.5 even says "Zero-length arrays       do not have a first element," though another footnote in 8.5.1 says "C++       does not have zero length arrays." Is the standard contracting itself?              --       Seungbeom Kim                      [ See http://www.gotw.ca/resources/clcm.htm for info about ]        [ comp.lang.c++.moderated. First time posters: Do this! ]              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca