|
Boost : |
Subject: Re: [boost] Formal Review Request: TypeErasure (docs, Concept Maps misnamed?)
From: Larry Evans (cppljevans_at_[hidden])
Date: 2012-06-21 21:00:14
On 06/21/12 13:17, Steven Watanabe wrote:
> AMDG
>
> On 06/21/2012 10:34 AM, Larry Evans wrote:
>>
>> The page:
>> */libs/type_erasure/doc/html/boost_typeerasure/conceptdef.html
>> uses the term 'primitive concept':
>>
>> A primitive concept must be a specialization of a class template,
>> with a static member function called apply.
>>
>> What's the difference between a 'Concept Map' and 'primitive concept'?
>> If they are the same, why not use the same term for both?
>> [snip]
>>
>
> They aren't the same. A primitive
> concept specified the interface and
> (optionally) a default Concept Map.
> A Concept Map specifies how a specific
> type models the concept.
>
Would not:
template<class T = _self, class U = T>
struct less_than_comparable
{
static bool apply(const T& lhs, const U& rhs) { return lhs < rhs; }
};
from:
http://svn.boost.org/svn/boost/sandbox/type_erasure/boost/type_erasure/operators.hpp
satisfy the definition you give above for a primitive concept:
A primitive concept specified the interface and
(optionally) a default Concept Map.
Where the optional default Concept Map is the general template, as
shown in the above operator.hpp. Somehow, I assume by "specified the
interface" you mean, somehow, the specialization idea:
A primitive concept must be a specialization of a class template,
with a static member function called apply.
from:
*/libs/type_erasure/doc/html/boost_typeerasure/conceptdef.html
IOW, an example of "specified the interface" would be the
specialization of less_than_comparable,
less_than_comparable<std::type_info>
shown here:
*/libs/type_erasure/doc/html/boost_typeerasure/concept.html#boost_typeerasure.concept.concept_map
Of course, I could be completely wrong; hence, could you be more
specific about what you mean by "specified the interface" and
"(optionally) a default Concept Map"?
I can't help but draw the conclusion that a "Concept Map" is simply
the general template and all specializations of a:
class template, with a static member function called apply
as mentioned in conceptdef.html; however, I also feel that's way too
simple. What am I missing?
TIA.
-regards,
Larry
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk