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,014 of 33,346    |
|    =?ISO-8859-1?Q?Daniel_Kr=FCgler?= to All    |
|    Re: Can you ever mix an exception spec w    |
|    15 Mar 12 23:30:20    |
   
   ddfee5e0   
   From: daniel.kruegler@googlemail.com   
      
   Am 15.03.2012 22:54, schrieb Daryle Walker:   
   > The reason is that I wanted built-in integer   
   > members to be zero, which means value-initialization, while defaulting   
   > a default constructor does default-initialization (duh).   
      
   In this case you can combine the advantages of defaulting with that of   
   data-member initializers. Consider:   
      
   struct C {   
    int i{};   
    C() noexcept = default;   
   };   
      
   which performs value-initialization of the int member irrespective of   
   the form of the initialization.   
      
   > * Value-initialization   
   > -- Default-initialization for class types   
      
   We have a bit more here: For class types without user-provided or   
   deleted default-constructor, the object becomes additionally   
   zero-initialized.   
      
   > -- Zero-initialization for built-in integer and pointer types   
   > -- (I'm not sure what happens for enumeration types.)   
      
   Enumeration types are also zero-initialized.   
      
   HTH & Greetings from Bremen,   
      
   Daniel Krügler   
      
      
   --   
    [ 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