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,528 of 33,346   
   Dave Harris to Seungbeom Kim   
   Re: Using the STL for scientific program   
   03 Oct 11 11:56:48   
   
   From: brangdon@cix.co.uk   
      
   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. The standard   
   reserves for itself lots of freedoms and those translate into   
   restrictions for users.   
      
   The consequence is that I can't use std::vector in a header, without also   
   including the definition of MyData, which pollutes the namespace and   
   causes more and longer recompiles. I can't forward-declare std::vector<>   
   itself, either.   
      
   -- Dave Harris, Nottingham, UK.   
      
      
   --   
         [ 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