Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost-users Digest, Vol 1945, Issue 2
From: Ovanes Markarian (om_boost_at_[hidden])
Date: 2009-03-25 08:47:31


On Wed, Mar 25, 2009 at 11:04 AM, tom tan <ttan_at_[hidden]> wrote:

>
>
> I need some dynamically allocated space that can later be casted to C
> pointers,
> so that it can be passed to a Win32 API function that accepts C pointers
> only.
> vectors are dynamic, but they don't cast to C arrays naturally.
> In fact, I am wrapping that API in C++. is there a better way?
>

The first paragraph of the C++ standard which describes vector class
guarantees for verctor<T> (not vector<bool>) to provide the pointer to a
continuous block of Ts by using: &vec[0]. vector<bool> is specialization
which stores bool values bitwise.

Greetings,
Ovanes



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net