Boost logo

Boost Users :

From: me22 (me22.ca_at_[hidden])
Date: 2005-04-21 15:15:59


On 4/20/05, Sean DeNigris <lotusone_at_[hidden]> wrote:
>
> LibraryFunction(0, &bytesNeeded);
> scoped_array<Type>(static_cast<PType>(new
> BYTE[bytesNeeded]));
>

I'm not sure if that would nessesarily work properly depending on how
your architecture requires things to be aligned...

How about this?:
scoped_array<Type>( new Type[ bytesNeeded / sizeof(Type) ] );

I think that should work, so long as LibraryFunction includes any padding.

- Scott McMurray


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