Boost logo

Boost Users :

From: sr kumar (srgama_at_[hidden])
Date: 2005-08-06 11:04:10

I am having trouble understanding why the following concept_check,
which checks an inheritance relationship, doesn't work but the

Just to make sure that the concept does actually work, the
LessThanComparableConcept was implemented and then commented out.

Would appreciate getting the missing link in my understanding.

thanks in advance for all help,


#include <boost/static_assert.hpp>
#include <boost/concept_check.hpp>
#include <boost/type_traits.hpp>

using namespace boost;

template <typename T>
struct MyConcept {
    void constraints() {
        (bool)(boost::is_base_and_derived<int,T>::value == true);
// (bool)(a<b);
// T a,b;

class X {
    X() {
        function_requires<MyConcept<X> > ();
          (is_base_and_derived<int,X>::value == true));
// bool operator<(X& rhs) { return (x < rhs.x); }
    int x;

int main() { return 0;}

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at