|
Boost Users : |
Subject: Re: [Boost-users] [range] questions about documentation and usage
From: Robert Ramey (ramey_at_[hidden])
Date: 2012-11-04 16:04:04
Vicente J. Botet Escriba wrote:
> Le 04/11/12 09:37, Robert Ramey a écrit :
>> c) Declare concept archtypes from reading your documentation.
>> This is described in the Boost Concept library documentation.
>> This archtype class looks like:
>>
>> template <class T>
>> SinglePassRangeArchType {
>> // examples of "valid expressions" from the documentation go
>> here };
>>
>> OK First red flag - the "valid expressions" are members of type T
>> so it's not at all clear to me how to fill this in.
> I don't know from where you got that "valid expressions" should use
> member types. Concepts can concern non-member functions, think for
> example of a Swapable concept.
Actually it's worse than that. The serialization library uses them for
non-intrusive serialization implementation. I realized this when i was
doing some double checking before posting. (yes, I sometimes to
that!).
And I did moderate my insistence on this particular point.
But still....
looking through http://en.cppreference.com/w/cpp/concept
it seems that swappable/valueswappable is a very unusual
and perhaps even unique case. I suspect this would be for
the same reason that boost::begin(A) as a required expression
raised a red flag when I looked at it. This technique/practice
creates a concept which I can't easily verify. A couple of
other points.
a) I don't think it (boost::begin()) is necessary to implement
the library.
b) I don't find any mention of boost::begin() anywhere in the table
of contents of the documentation. I guess it might be implemented
somewhere for some types like stl containers
(extending the library Method 1: refers to begin() member
functions of a user type to be supported - but that would be
a different thing)
So I'll concede your point that including boost::begin() as a
required valid expression does not violate any rules. But I don't
think such a thing belongs here.
Robert Ramey
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