$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-users] 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