POV-Ray : Newsgroups : povray.off-topic : Microsoft may have done something right... : Re: Microsoft may have done something right... Server Time
11 Oct 2024 01:24:57 EDT (-0400)
  Re: Microsoft may have done something right...  
From: Fredrik Eriksson
Date: 25 Mar 2008 12:57:06
Message: <op.t8k2th187bxctx@e6600.bredbandsbolaget.se>
On Tue, 25 Mar 2008 17:34:14 +0100, Nicolas Alvarez  
<nic### [at] gmailisthebestcom> wrote:
> C++ STL vector template class has a specialization for 'bool' that uses  
> 1 bit per element too. That is, a vector<bool> takes 1 bit per element.

Yes, but that specialisation is largely considered a mistake because it  
breaks the interface associated with the generic std::vector. Also, there  
is no actual requirement that the elements occupy a single bit each; this  
is left up to the implementation.
There is std::bitset, but that does not use dynamic allocation.


-- 
FE


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.