From: Jan Gaspar (jga_at_[hidden])
Date: 2003-07-23 04:17:45
I think, I changed mind. The flatten() method can be substituted by something like
void doSomething(const int* pInt, size_t numInts); // C API
fill the buffer somehow
vector<int> v(intBuffer.begin(), intBuffer.end()); // copy
if (!v.empty()) doSomething(&v, v.size()); // pass the data to the API
// &v < &v < ... < &v[n]
I think, we should rather keep the interface minimal.
Pavel Vozenilek wrote:
> Would it be possible to add helper function 'flatten()' into
> After invocation, user would be sure of:
> &buff < &buff < ... < &buff[n]
> In other words, user will be able to treat circular_buffer content as
> continuous array of values in this moment.
> It is not earth shaking feature, it violates 'minimal interface' ideal but
> can be handy:
> - when legacy C function requires continuous array (like Win32 API)
> - when buffer is being saved to file or written to socket
> - special purpose adaptor could present result as (nonresizable) vector<>
> Alternatives are simple but much more CPU/memory expensive.
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
-- Jan Gaspar | jga_at_[hidden] Whitestein Technologies | www.whitestein.com Panenska 28 | SK-81103 Bratislava | Slovak Republic Tel +421(2)5930-0735 | Fax +421(2)5443-5512
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk