Boost logo

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

What do you think?


View this message in context:
Sent from the Boost - Dev mailing list archive at

Boost list run by bdawes at, gregod at, cpdaniel at, john at