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 31,536 of 33,346   
   =?ISO-8859-15?Q?Daniel_Kr=FCgler?= to All   
   Re: Using the STL for scientific program   
   04 Oct 11 15:39:20   
   
   From: daniel.kruegler@googlemail.com   
      
   Am 04.10.2011 20:17, schrieb Daniel Krügler:   
   > Am 03.10.2011 20:56, schrieb Dave Harris:   
   >> musiphil@bawi.org (Seungbeom Kim) wrote (abridged):   
   >>> Then is new[]/delete[] your preferred choice?   
   >>> What benefits does it bring, and why would you prefer it to   
   >>> std::vector?   
   >>   
   >> As a petty example, you can't write:   
   >>   
   >> #include   
   >> class MyData;   
   >> std::vector vec;   
   >>   
   >> because it's undefined behaviour to instantiate a std::vector on a   
   >> partial type. Where-as with my home-grown vector, I can.   
   >   
   > With a grain of salt, yes. It would still be undefined behaviour, if   
   > MyData has a non-trivial destructor or a deallocation function.   
      
   I was wrong here. Since the vector is empty there is no undefined behaviour   
   involved.   
      
   I apologize for any confusion,   
      
   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