Boost logo

Boost Users :

Subject: Re: [Boost-users] [range] questions about documentation and usage
From: Nathan Crookston (nathan.crookston_at_[hidden])
Date: 2012-11-02 13:41:05


On Fri, Nov 2, 2012 at 11:20 AM, Robert Ramey <ramey_at_[hidden]> wrote:
> Nathan Ridge wrote:
>> "This library therefore provides the means to adapt standard-like
>> containers,
>> null terminated strings, std::pairs of iterators, and raw arrays (and
>> more),
>> such that the same generic code can work with them all. The basic
>> idea is
>> to add another layer of indirection using metafunctions and
>> free-standing
>> functions so syntactic and/or semantic differences can be removed."

> This is all beside the point.
>
> My concern is very simple:
>
> The page
> http://www.boost.org/doc/libs/1_51_0/libs/range/doc/html/range/concepts/single_pass_range.html
> is crystal clear. It says that any SinglePassRange must implement the
> expression boost::begin(a) where a is a model of a SinglePassRange.
>
On the page you reference, it describes that a particular expression
must be valid for types modeling the SinglePassRange concept. It
doesn't claim that you must implement it.

I admit that it's a fine distinction. I thought that the "See Also"
section on that same page was helpful, however -- the link titled
"Extending the library for UDTs" seems to provide the information
you're looking for.

> This is not actually a requirement on any model of a SinglePassRange but
> rather a requirement on boost::begin. But boost::begin is not supplied by
> the user! This documentation doesn't tell me what operation the type
> argument has to support in order to be used as argument to a range. It's
> just non-sensical and therefore confusing. There is nothing on this page
> which would indicate to me that something like <vector> would satisify the
> concept. The page is does not document a "concept" in the C++ manner.
I'd be interested to hear opinions on this also -- it made sense to
me, but I didn't start adapting my own ranges until I was fairly
comfortable with using the library with the standard containers.

Nate


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net