Hi
MSVC 7.1, Windows 2000
I'm trying to get to grips with the boost lambda library. I've
managed to get the first example to work:
#include
#include <iostream>
#include <cstdlib>
#include <list>
#include <algorithm>
int main()
{
using namespace std;
using namespace boost::lambda;
list<int> v(10);
for_each(v.begin(), v.end(), _1 = 12 );
return EXIT_SUCCESS;
}
Â…but when I add the following line (also from the docs):
for_each( v.begin(), v.end(), cout << *_1 << '\n' );
I get the following errors:
error C2039: 'reference' : is not a member
of 'std::iterator_traits<int>'
error C2146: syntax error : missing ';' before identifier 'type'
error C2501: 'boost::lambda::detail::contentsof_type<A>::type' :
missing storage-class or type specifiers
error C2039: 'type' : is not a member
of 'boost::lambda::detail::contentsof_type<A>'
error C2146: syntax error : missing ';' before identifier 'type'
I've tried including some the other Lambda headers but this didn't
improve the situation.
Regards
Paul