Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-10-22 11:32:51


Pavol Droba <droba_at_[hidden]> writes:

> On Wed, Oct 22, 2003 at 09:34:44AM -0400, David Abrahams wrote:
>> Pavol Droba <droba_at_[hidden]> writes:
>>
>> > On Tue, Oct 21, 2003 at 05:48:27PM -0400, David Abrahams wrote:
>
> [snip]
>
>> >
>> > Sorry, the definition is not exact. I have used the C++ syntax, but
>> > I merely wanted to list the requiremnts. The fact is, that it is not
>> > required, that f.e. a container have .begin() member function. It is
>> > only required, that such a function is accessible. Having the
>> > container_traits and freestanding begin(), it is well defined for
>> > C-arrays.
>>
>> You still need a tight definition of the requirements.
>>
>
> Definition will be provided in docs. The format will be the same as the
> concept definitions which are already there.
>
> As far as I see, this concept should be defined in the terms of operations
> that are provided by container_traits.
>
> <example>
>
> Valid expressions | Return Types | Effects
> | |
> begin(C) | container_const_iterator<C>::type when C is const | returns an iterator pointing
> | container_iterator<C>:type when C is mutable | to the first element in the container
>
> end(C) | container_const_iterator<C>::type when C is const | returns an iterator pointing
> | container_iterator<C>::type when C is mutable | after the last element in the container
>
> size(C) | container_size_type<C>::type | returns the number of elements in the container
>
> </example>
>
> container_traits can be then described as a facility which provides this interface for
> build-in types like C-arrays and STL containers

Then you also need to decide whether those functions are meant to be
called with or without the boost::qualification.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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