POV-Ray : Newsgroups : povray.off-topic : C++: Seriously? : Re: C++: Seriously? Server Time
28 Jul 2024 16:18:46 EDT (-0400)
  Re: C++: Seriously?  
From: Orchid Win7 v1
Date: 21 Nov 2013 17:19:52
Message: <528e8708$1@news.povray.org>
On 21/11/2013 09:15 PM, Warp wrote:
> Orchid Win7 v1<voi### [at] devnull>  wrote:
>> The suggested solution? "Why don't you just use a std::vector<char>?"
>
>> Erm... because std::vector<char>  /= char *. One is basically an
>> unstructured chunk of arbitrary memory, this other is a complex
>> implementation-dependent data structure.
>
> std::vector is not very implementation-dependent because the standard
> guarantees certain properties for it. One of these properties is that
> std::vector will always allocate contiguous memory (in the same way
> as 'new[]' does.)

The standard actually *promises* this? So there is literally only one 
possible implementation for vector?

Wow. My mind is blown...


Post a reply to this message

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