#include <iostream>
#include<boost/array.hpp>
int main()
{
boost::array<int, 6> arr = {1,2,3,4,5,6};
boost::array<int, 6> arr2 = {7,8,9,10,11,12};
std::copy(arr.begin(), arr.end(), std::ostream_iterator<int>(std::cout, " "));
std::cout<<std::endl;
arr.swap(arr2);
for(size_t i=0;i<arr.size();i++)
{
std::cout<<arr.at(i)<<" ";
}
std::cout<<std::endl;
return 0;
}

boost array是一种静态数组,比stl中的vector效率高

boost array使用的更多相关文章

  1. #include <boost/array.hpp>

    Boost的array,元素可以是std::string #include <iostream> #include <string> #include <boost/ar ...

  2. boost array

    boost::array is similar to std::array, which was added to the standard library with C++11. With boos ...

  3. Array的简单使用(Boost和STL通用)

    目录 目录 介绍 使用 Boost和STL的区别 介绍 本来这一次是想简单介绍一下Boost里面的协程库的使用的,但是Boost.Coroutine已经被废弃了,而Boost.Coroutine2目前 ...

  4. BOOST.Asio——Tutorial

    =================================版权声明================================= 版权声明:原创文章 谢绝转载  啥说的,鄙视那些无视版权随 ...

  5. boost:进程管理

    概述 Boost.Process提供了一个灵活的C++ 进程管理框架.它允许C++ developer可以像Java和.Net程序developer那样管理进程.它还提供了管理当前执行进程上下文.创建 ...

  6. boost库在工作(36)网络服务端之六

    在上面介绍了管理所有连接的类,这个类主要就是添加新的连接,或者删除不需要的连接.但是管理的类CAllConnect是没有办法知道什么时候添加,什么时候删除的,它需要从接收到连接类里获取得到新的连接,从 ...

  7. boost.ASIO-可能是下一代C++标准的网络库

    曾几何时,Boost中有一个Socket库,但后来没有了下文,C++社区一直在翘首盼望一个标准网络库的出现,网络上开源的网络库也有不少,例如Apache Portable Runtime就是比较著名的 ...

  8. boost库在工作(37)网络UDP服务端之七

    前面介绍的都是网络TCP的服务器和客户端,其实还有UDP的服务器和客户端,同时也有同步和异步之分.UDP与TCP最大的区别,就是TCP是基于连接的,而UDP是无连接的.这里所谓的连接是指对方中断服务时 ...

  9. boost库在工作(32)网络服务端之二

    在这个例子里,服务器对象主要使用boost::asio::io_service对象,这个对象主要用来构造异步接收数据使用,接着定义boost::asio::ip::tcp::acceptor对象,这个 ...

随机推荐

  1. (SenchaTouch+PhoneGap)开发笔记(1)开发环境搭建一

    1.下载senchaTouch 2.下载senchaCMD 3.安装ruby(for windows ) 4.senchaCmd创建项目: 打开senchacmd,cd到senchaTouch的目录如 ...

  2. asp.net自己创建的app_code文件夹中的类不能访问的解决办法

    在Web应用程序中不能通过右键项目-〉”添加“-〉”添加ASP.NET文件夹“方式添加 .因为Web应用程序中App_Code就不存在 .不过可以通过手动的方式创建,添加一个文件夹命名为App_Cod ...

  3. Java中使用二重循环打印沙漏图形

    1.首先判断外层,A .B.C.D都符合条件 2.那么再看内层 A :int i=0;i<5;i++ 当i=1时;带入到第二个内层循环中 int j=0;j<Math.abs(i)*2+1 ...

  4. Yii2 rules 添加时间比较功能

    php比较类文件:yiisoft\yii2\validators\CompareValidator.php JS比较类文件: yiisoft\yii2\assets\yii.validation.js ...

  5. 【初级】linux mkdir 命令详解及使用方法实战

    mkdir命令详解及使用方法实战 名称 MKDIR 是 make directories 的缩写 使用方法 mkdir [选项(如-p)] ...目录名称(及子目录注意用分隔符隔开)...    如使 ...

  6. cheap gucci bags for women finish fashion jewellery has to move

    Is certainly his dresser seem or dress creation process into video clip. Bus dropped???? Especially ...

  7. Basic linux command-with detailed sample

    Here I will list some parameters which people use very ofen, I will attach the output of the command ...

  8. Y+的一些讨论

    一.关于 fluent计算时壁面函数法和网格的关系,还有一个小问题 1:各位用 fluent的同仁和高手们,我想要比较好的使用 fluent软件,最重要的就是要学好理 论,在这里我想请教各位一个问题, ...

  9. elasticsearch rpm 安装

    参考:http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/setup-repositories.html Dow ...

  10. ArrayList和Vector的区别

    3.ArrayList和Vector的区别 答: 这两个类都实现了List接口(List接口继承了Collection接口),他们都是有序集合,即存储在这两个集合中的元素的位置都是有顺序的,相当于一种 ...