home bbs files messages ]

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,196 of 33,346   
   =?ISO-8859-1?Q?Daniel_Kr=FCgler?= to All   
   Re: Initialization and trivial construct   
   25 Apr 12 17:01:39   
   
   From: daniel.kruegler@googlemail.com   
      
   Am 25.04.2012 21:11, schrieb James K. Lowden:   
   > On Tue, 24 Apr 2012 16:15:56 -0700 (PDT)   
   > nroberts  wrote:   
   >   
   >> Although you cannot construct a POD with values   
   >> in the initializer (not in C++03 and earlier anyway)   
   >   
   > I'm confused by that statement.  You seem to be saying the code below   
   > wouldn't compile, but it does and I'm sure you would expect it to.   
   >   
   >    class A   
   > {   
   >     int a;   
   > public:   
   >     A( int a ) : a(a) {}   
   > };   
   >   
   > int i(17);   
   >   
   > What am I missing?   
      
   I think that nroberts actually wanted to refer to POD classes, not to   
   POD types (like int) in general.   
      
   If that is not what you where trying to say: A is not a POD type in   
   C++03 (This would require it to be an aggregate type, thus it excludes   
   all types with a user-provided constructor). It is also no POD type in   
   C++11 but now only because it does not have a default constructor (This   
   is somehow an astonishing result given the fact that a deleted default   
   constructor is considered as trivial).   
      
   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