Boost logo

Boost Users :

From: pirx (p_i_r_x_at_[hidden])
Date: 2003-03-12 12:44:51


hi,

I've got a question regarding the compose_f_gx function object.
I tried to use it in combination with this small example.

class Element
{
      public:
        explicit Element(int nVal) : m_nValue(nVal) {}
        const int getValue() const { return m_nValue; }

      private:
        int m_nValue;
};

Element el(3);

// a == true;
bool a = bind<bool>(equal_to<int>(), _1, 3)(3);

// b == 3;
int b = mem_fn(&Element::getValue)(el);

// c == true
bool c = bind<bool>(equal_to<int>(), _1, 3)
             (mem_fn(&Element::getValue)(el));

// d should also be true, but does not compile
bool d = compose_f_gx(bind<bool>(equal_to<int>(), _1, 3),
                          mem_fn(&Element::getValue))(el);

The last line does not compile. I don't know why.
So what's wrong?

thanks, andreas


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net