fixed some KCC stuff and changed less_than_op to tighten up what it provides

[SVN r8383]
This commit is contained in:
Jeremy Siek
2000-12-03 23:17:23 +00:00
parent ffa42dd200
commit e375e4ce47
2 changed files with 62 additions and 72 deletions
+23 -6
View File
@@ -224,25 +224,42 @@ namespace boost {
operator>=(const comparable_archetype<Base>&,
const comparable_archetype<Base>&)
{ return boolean_archetype(dummy_cons); }
// The purpose of the optags is so that one can specify
// exactly which types the operator< is defined between.
// This is useful for allowing the operations:
//
// A a; B b;
// a < b
// b < a
//
// without also allowing the combinations:
//
// a < a
// b < b
//
struct optag1 { };
struct optag2 { };
struct optag3 { };
#define BOOST_DEFINE_BINARY_PREDICATE_ARCHETYPE(OP, NAME) \
template <class Base = null_archetype<> > \
template <class Base = null_archetype<>, class Tag = optag1 > \
class NAME##_first_archetype : public Base { \
public: \
NAME##_first_archetype(detail::dummy_constructor x) : Base(x) { } \
}; \
\
template <class Base = null_archetype<> > \
template <class Base = null_archetype<>, class Tag = optag1 > \
class NAME##_second_archetype : public Base { \
public: \
NAME##_second_archetype(detail::dummy_constructor x) : Base(x) { } \
}; \
\
template <class BaseFirst, class BaseSecond> \
template <class BaseFirst, class BaseSecond, class Tag> \
boolean_archetype \
operator OP (const NAME##_first_archetype<BaseFirst>&, \
const NAME##_second_archetype<BaseSecond>&) \
operator OP (const NAME##_first_archetype<BaseFirst, Tag>&, \
const NAME##_second_archetype<BaseSecond, Tag>&) \
{ \
return boolean_archetype(dummy_cons); \
}