Boost logo

Boost :

From: Nigel Stewart (nigels_at_[hidden])
Date: 2003-07-23 11:39:17


> I suggest
>
> T * circular_buffer<T>::data();

Poses the question of how a const circular_buffer
could be accessed as a const array:

const T * const circular_buffer<T>::data()
{
        ??
}

BTW - As question for the boost gurus, is there
some way of capturnig a pointer+size for a memory
block (perhaps pointing into a vector or raw
memory) that is encapsulated? A circular_buffer
can always be accessed as upto two contiguous
memory blocks without the need to reorganise
internally, and without any problem dealing with
a const circular_buffer.

For some reason I've been inclined to do some
pointer style programming lately, but it's
awkward always maintaining ptr and size --
some concept of a block of memory
(fixed size, const and/or non-const) would
be handy.

Nigel


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