Boost logo

Boost :

From: albert meyburgh (ameyburgh_at_[hidden])
Date: 2008-06-13 18:37:58


Hi,

I'm trying to use the lambda constructor provided in boost and it's not
compiling.

class someclass
{
someclass(sometype, int x)
}

std::vector v<sometype>
std::vector v2<someclass>
std::transform( v.begin(),
                    v.end(),
                    std::back_inserter( v2 ),
                    boost::bind( boost::lambda::constructor<someclass>(),
_1, 5) ); // where 5 is a constant int parameter for x to the constructor

Resulting in

Error 1 error C2039: 'result_type' : is not a member of
'boost::lambda::constructor<T>' boost_1_35_0\boost\bind.hpp 67
Error 2 error C2146: syntax error : missing ';' before identifier
'type' boost_1_35_0\boost\bind.hpp 67
Error 3 error C4430: missing type specifier - int assumed. Note: C++
does not support default-int boost_1_35_0\boost\bind.hpp 67
Error 4 error C2208: 'boost::_bi::type' : no members defined using
this type boost_1_35_0\boost\bind.hpp 67
Error 5 fatal error C1903: unable to recover from previous error(s);
stopping compilation boost_1_35_0\boost\bind.hpp 67

What is wrong with my syntax?


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk