$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Peter Dimov (pdimov_at_[hidden])
Date: 2007-04-16 17:31:09
Eric MALENFANT wrote:
> 2)
> var_type<std::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 ) )
)
)
);