
16 Apr
2007
16 Apr
'07
9:31 p.m.
Eric MALENFANT wrote:
2) var_typestd::string::type temp(var(std::string()));
std::for_each( begin, end, bind(Print, bind(&std::string::c_str, (temp = bind(&A::name, _1)) ) ) );
Note that this is more "for fun" than, anything.
In the "for fun" spirit, here's the boost::bind equivalent: string& (string::*assign)( string const & ) = &string::operator=; std::for_each( begin, end, bind( Print, bind( &std::string::c_str, bind( assign, string(), bind( &A::name, _1 ) ) ) ) );