Boost logo

Boost :

From: Rainer Deyke (rainerd_at_[hidden])
Date: 2003-07-23 07:57:53


Jan Gaspar wrote:
> I think, I changed mind. The flatten() method can be substituted by
> something like this:
>
> void doSomething(const int* pInt, size_t numInts); // C API
> circular_buffer<int> intBuffer(10);
> ...
> // fill the buffer somehow
> vector<int> v(intBuffer.begin(), intBuffer.end()); // copy
> if (!v.empty()) doSomething(&v[0], v.size()); // pass the data
> to the API

Not if 'doSomething' is a mutating operation.

-- 
Rainer Deyke - rainerd_at_[hidden] - http://eldwood.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk