Bind/lambda arithmetic question
Ok, I want to create a functor that takes no arguments and returns a double. Furthermore, I want this functor to be composed of functors itself. For instance: ============================= struct Foo { double getX() const{ return 5; } double getY() const { return 10; } }; Foo f; double z = (boost::bind(&Foo::getX, boost::ref(f)) / boost::bind(&Foo::getY, boost::ref(f))) (); ==================== The above code, however, generates the following error: error: no match for 'operator/' in 'boost::bind(R (T::*)() const, A1) [with R = double, T = Foo, A1 = boost::reference_wrapper<Foo>](boost::ref(T&) [with T = Foo]()) / boost::bind(R (T::*)() const, A1) [with R = double, T = Foo, A1 = boost::reference_wrapper<Foo>](boost::ref(T&) [with T = Foo]())' Is there a way to make the division operation of two functors work in this example? Thanks, --Steve Stephen Gross Case Western School of Medicine Cleveland, OH "By Grabthar's hammer, by the sons of Worvan, you shall be avenged." - Dr. Lazarus
participants (1)
-
Stephen Gross