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,954 of 33,346   
   A. McKenney to Leigh Johnston   
   Re: Sequence container capacity after ca   
   29 Mar 13 13:29:16   
   
   d662a69b   
   From: alan_mckenney1@this.is.invalid   
      
   Leigh Johnston wrote:   
   > On 28/03/2013 22:16, alan_mckenney1 wrote:   
   > > ... the size of   
   > > a std::array is determined at compile time.  I need it to be determined   
   > > at run time, but be allocated on the stack.   
   >   
   > Not sure if it quite fits your needs but you could try my "vecarray"   
   > container: you specify a maximum size as a template parameter (compile   
   > time) but actual number of elements can vary.   
      
   Nope.   
      
   If we knew the maximum size in advance (=at development time), the   
   problem would be trivial.  In many cases, normal C arrays would be   
   fine.   
      
   What we're trying to get away from is having to guess at a reasonable   
   (less then 2Gb :-) ) upper bound on the size and hoping we don't ever   
   have to   
   deal with data longer than that.  And from the performance hit of   
   heap storage for function-local data.   
      
      
   --   
         [ 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