Boost provides free peer-reviewed portable C++ source libraries. We emphasize libraries that work

源代码在线查看: function_output_iterator_eg.rst

软件大小: 35482 K
上传用户: sinba
关键词: libraries peer-reviewed emphasize provides
下载地址: 免注册下载 普通下载 VIP

相关代码

				.. 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)								Example				.......								::								    struct string_appender				    {					string_appender(std::string& s)					    : m_str(&s)					{}									void operator()(const std::string& x) const					{					    *m_str += x;					}									std::string* m_str;				    };								    int main(int, char*[])				    {				      std::vector x;				      x.push_back("hello");				      x.push_back(" ");				      x.push_back("world");				      x.push_back("!");								      std::string s = "";				      std::copy(x.begin(), x.end(), 						boost::make_function_output_iterator(string_appender(s)));								      std::cout 								      return 0;				    }							

相关资源