|
Boost : |
Subject: [boost] [type_erasure] default implementation of concept signatures
From: Vicente Botet (vicente.botet_at_[hidden])
Date: 2011-05-28 12:42:03
Hi Steve,
Concepts are able to define default implementations if the type doesn't
provides the specific signature. For example in 20.1.2 Comparisons the
concept LessThanComparable defines a default for implementation for
bool operator>(U const& a, T const& b) { return b < a; }
bool operator<=(U const& a, T const& b) { return !(b < a); }
bool operator>=(T const& a, U const& b) { return !(a < b); }
In the definition of the concept less_than_comparable in Boost.Any, you
define the implementation of these operators in function of operator<(), but
if the types provide the specific signature the specific function is not
called. I guess that the default implementation of for example operator<=
should use operator< only if the the underlying types don't provide
operator<=.
What do you think?
Best,
Vicente
-- View this message in context: http://boost.2283326.n4.nabble.com/type-erasure-default-implementation-of-concept-signatures-tp3557724p3557724.html Sent from the Boost - Dev mailing list archive at Nabble.com.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk