Boost logo

Boost :

From: Oliver Kullmann (O.Kullmann_at_[hidden])
Date: 2005-06-17 10:24:08


On Fri, Jun 17, 2005 at 10:27:53AM -0400, David Abrahams wrote:
> "Thorsten Ottosen" <nesotto_at_[hidden]> writes:
>
> > "David Abrahams" <dave_at_[hidden]> wrote in message
> > news:ull5bnykl.fsf_at_boost-consulting.com...
> > |
> > | 1. What does it take to get support for standard containers as ranges?
> > | According to what I can see in the documentation, the standard
> > | containers don't satisfy the range concepts. IOW,
> > |
> > | begin(v)
> > |
> > | isn't valid when v is a standard vector.
> > |
> > | From what I can tell from browsing the implementation, the
> > | requirement should be:
> > |
> > | boost::begin(v)
> >
> > doesn't it seem strange that a concept requirement is bound to a certain
> > namespace?
>
> Not really; especially if you show the "as-if" implementation of
> boost::begin. But more importantly, as far as I can tell from the
> code, that *is* the actual requirement! Otherwise, standard
> containers don't satisfy the concept. It doesn't matter how strange
> it seems if the alternative is inaccurate.
>
>

I don't think that the requirement should be

                    boost::begin(v);

since functions cannot be partially specialised, and only the
overload mechanism together with ADL is available to use a
user-defined begin-function. In cases like this I regard
the requirement

                    using boost::begin;
                    begin(v);

as the correct one:

 - now standard containers fulfil the requirement;
 - and used-defined versions of begin are taken into
   account.

Oliver


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