Boost logo

Boost Users :

Subject: Re: [Boost-users] [array] with variable size
From: Boris (boriss_at_[hidden])
Date: 2008-11-20 12:11:23


On Thu, 20 Nov 2008 17:00:51 +0100, Hicham Mouline <hicham_at_[hidden]>
wrote:

> Hello,
>
> I have a third-party library that gives me a number N of doubles,
> then expects from me a double* to an array where it will set N elements
>
> This would have happen many times and N is variable,
> so I wish not to reallocate the array each time.
>
> I know however N is maxed at some value Nmax like 50.
>
> I thought of using a array<double, Nmax> that would be allocated once,
> then perhaps have a wrapper around it so that only N elements of it
> can be accessed.
>
> This seems to be a usual idiom, are there ready implementations?

See boost_carray.zip from http://www.boostpro.com/vault/.

Boris


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