build-simple-head.rst
来自「Boost provides free peer-reviewed portab」· RST 代码 · 共 29 行
RST
29 行
.. Copyright David Abrahams 2006. Distributed under the Boost.. Software License, Version 1.0. (See accompanying.. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)Build a Simple Program Using Boost==================================To keep things simple, let's start by using a header-only library.The following program reads a sequence of integers from standardinput, uses Boost.Lambda to multiply each number by three, andwrites them to standard output:: #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) << " " ); }Copy the text of this program into a file called ``example.cpp``.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?