Boost logo

Boost Users :

From: Bruce Trask (bruce.trask_at_[hidden])
Date: 2008-07-23 00:07:01


Sun, Xiuxin wrote:
>
> HI all,
> when I try to compile the example code only use boost head-file in SunOS :
>
> #include <boost/lambda/lambda.hpp>
> #include <iostream>
> #include <iterator>
> #include <algorithm>
>
> int main()
> {
> using namespace boost::lambda;
> typedef std::istream_iterator<int> in;
>
> std::for_each(
> in(std::cin), in(), std::cout << (_1 * 3) << " " );
> }

Try this:
     typedef std::istream_iterator<int> in;

     std::for_each(
         in(std::cin), in(), std::cout << boost::lambda::_1*3 << " " );
HTH,
Bruce
>
> I get many errors like 'Unexpected type name', the first one is :
>
> CC -g -I../. -c -o main.o main.C
> ".././boost/lambda/detail/function_adaptors.hpp", line 203: Error:
> Unexpected type name "boost::lambda::Arg1" encountered.
>
> could someone give a hand.
>
> sun
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net