|
Boost Users : |
From: Christian Henning (chhenning_at_[hidden])
Date: 2007-03-09 15:49:43
Thanks Peter, it needs to be:
using namespace std;
using namespace boost;
struct a {};
struct b {};
void foo( string& s, a ) {}
void foo( string& s, b ) {}
void two( int, int ) {}
int _tmain(int argc, _TCHAR* argv[])
{
string str( "Hello" );
bind( static_cast<void(*)(string&, a )>( &foo ), _1, _2)( ref( str ) , a() );
return 0;
}
On 3/9/07, Peter Dimov <pdimov_at_[hidden]> wrote:
> Christian Henning wrote:
>
> > bind( static_cast<void(*)(string&, a )>( &foo ), ( ref( str ), a() ));
>
> The (x, y) expression returns y. In your case (ref(str), a()) is equivalent
> to just a().
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net