|
Boost : |
Subject: [boost] correct usage of bind
From: Sandeep Gupta (gupta.sandeep_at_[hidden])
Date: 2009-03-17 17:54:49
Hi,
Both the statements below bind function buildPair. While the first
works the other fails. What could be a possible fix. Thanks in
advance.
//---- Function to be used by bind -------------------------
template<typename X, typename Y>
std::pair<X, Y> buildPair(X x, Y y)
{
std::pair<X,Y> apair(x,y);
return apair;
}
(std::cout<<buildPair(_1,_2).first<<' ')(1,2); ///--compiles fine---------
(bind(buildPair,_1,_2))(3,5); ///-fails------------
Thanks
sandeep
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk