[phoenix] problem when trying to access member via arg1
Hi, I have below test program in which I try to call a function on each map object. It compiles and runs fine with gcc 4.5 but not on vc10. Is arg1 and ->* operator supposed to work when arg1 is an object and not pointer? Or is there another way of accessing members with arg1 (i.e. without phoenix::bind)? Regards, Chris ----------------------- #include <boost/phoenix/core.hpp> #include <boost/phoenix/operator.hpp> #include <iostream> #include <vector> #include <boost/range/algorithm.hpp> #include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp> struct A { void f (int s) const { std::cout << "Calling f (" << s << ")...\n"; } }; int main (int argc, const char **argv) { typedef std::map<int, boost::shared_ptr<A> > map_type; typedef map_type::value_type value_type; map_type a_map; a_map[3] = boost::shared_ptr<A> (new A ()); namespace phoenix = boost::phoenix; using phoenix::arg_names::arg1; boost::for_each (a_map, ((arg1->*&value_type::second)->*&A::f) (10)); } ---------------------------
participants (1)
-
Christian Hoffmann