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
#include
#include <iostream>
#include <vector>
#include
#include
#include
struct A
{
void f (int s) const { std::cout << "Calling f (" << s << ")...\n"; }
};
int
main (int argc, const char **argv)
{
typedef std::map 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));
}
---------------------------