본문 바로가기
C++/0x02-boost

boost example

by SpeeDr00t 2016. 8. 1.
반응형

boost example

1.소스

#include <boost/lambda/lambda.hpp>
#include <iostream>
#include <iterator>
#include <algorithm>


using namespace boost::lambda;

int main()
{
    typedef std::istream_iterator<int> in;

    std::for_each(
        in(std::cin), in(), std::cout << (_1 * 3) << " " );

    std::cout << std::endl;
}

결과

hacker@ubuntu:~/cpp$ c++ -I /home/hacker/boost_1_61_0 -o example_boost example_boost.cpp
hacker@ubuntu:~/cpp$ echo 1 2 3 | ./example_boost 
3 6 9 


반응형

'C++ > 0x02-boost' 카테고리의 다른 글

boost replace  (0) 2016.08.01
boost find  (0) 2016.08.01
boost trimming  (0) 2016.08.01
boost helloworld  (0) 2016.08.01
boost example2  (0) 2016.08.01