Boost logo

Boost :

From: Craigp (craigp_at_[hidden])
Date: 2003-08-25 00:27:54

I tried the following example (taken from ,
and it failed to compile:

  std::vector<int> x(10);
  std::vector<int> y(10);
  std::vector<std::pair<int, int> > pairs;
  std::transform(x.begin(), x.end(), y.begin(), std::back_inserter(pairs),
    boost::bind(boost::lambda::constructor<std::pair<int, int> >(), _1,

c:\dev\boost-1.30.2\boost\bind.hpp(60) : error C2039: 'result_type' : is not
a member of 'boost::lambda::constructor<T>'
        c:\dev\boost-1.30.2\boost\bind\bind_template.hpp(16) : see reference
to class template instantiation 'boost::_bi::result_traits<R,F>' being
        c:\dev\projects\boost\main.cpp(67) : see reference to class template
instantiation 'boost::_bi::bind_t<R,F,L>' being compiled

c:\dev\boost-1.30.2\boost\bind.hpp(60) : error C2146: syntax error : missing
';' before identifier 'type'
c:\dev\boost-1.30.2\boost\bind.hpp(60) : error C2955: 'boost::_bi::type' :
use of class template requires template argument list
        c:\dev\boost-1.30.2\boost\bind.hpp(92) : see declaration of
c:\dev\boost-1.30.2\boost\bind.hpp(60) : fatal error C1903: unable to
recover from previous error(s); stopping compilation

In boost/lambda/construct.hpp, I added the following line, and it worked:
template<class T> struct constructor {
  template <class U> struct sig { typedef T type; };
+  typedef T result_type;
  T operator()() const {
    return T();

Boost list run by bdawes at, gregod at, cpdaniel at, john at