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,189 of 33,346   
   Martin B. to Miles Bader   
   Re: Initialization and trivial construct   
   24 Apr 12 01:08:03   
   
   From: 0xCDCDCDCD@gmx.at   
      
   On 24.04.2012 06:22, Miles Bader wrote:   
   > brangdon@cix.compulink.co.uk (Dave Harris) writes:   
   >> o Unable to add more code between initialisations (so it doesn't   
   >> scale).   
   >   
   > This is absolutely my main complaint about initializer lists -- I find   
   > it a very common case that I want to calculate an intermediate value   
   > based on the constructor arguments, and then use that value to   
   > initialize several data members.  The initializer-list form makes this   
   > quite annoying.   
   > (...)   
   > you basically _can't_ avoid initializers in any sane C++ code base, so   
   > the devs are going to be using them a lot regardless -- and once   
   > you're using them, you may as well use them always, because that   
   > _reduces_ the variance (I'd say that initializers can be used pretty   
   > painlessly like 98% of the time).   
   >   
      
   Hmmm ... Miles - you write "I find it a very common case (...)" and then   
   you write "painlessly like 98% of the time".   
      
   So, is 2% a common case? ;-)   
      
   It would be very interesting to get a real number (from you or   
   elsewhere) of how many constructors written really need to calculate   
   itermediate values for multiple member vars.   
      
   cheers,   
   Martin   
      
   --   
   Good C++ code is better than good C code, but   
   bad C++ can be much, much worse than bad C code.   
      
      
         [ 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