boost array
boost::array is similar to std::array, which was added to the standard library with C++11. With boost::array, an array can be created that exhibits the same properties as a C array. In addition, boost::array conforms to the requirements of C++ containers, which makes handing such an array as easy as handling any other container.
#include <boost/array.hpp>
#include <string>
#include <algorithm>
#include <iostream> int main() {
boost::array<std::string, > a;
a[] = "cat";
a.at() = "shark";
*a.rbegin() = "spider"; std::sort(a.begin(), a.end()); for (const std::string& s: a) {
std::cout << s << std::endl;
} std::cout << a.size() << std::endl;
std::cout << a.max_size() << std::endl;
return ;
}
using boost::array is fairly simple and needs no additional explanation since the member functions called the same meaning as their counterparts from std::vector.
boost array的更多相关文章
- boost array使用
#include <iostream> #include<boost/array.hpp> int main() { boost::array<int, 6> ar ...
- #include <boost/array.hpp>
Boost的array,元素可以是std::string #include <iostream> #include <string> #include <boost/ar ...
- Array的简单使用(Boost和STL通用)
目录 目录 介绍 使用 Boost和STL的区别 介绍 本来这一次是想简单介绍一下Boost里面的协程库的使用的,但是Boost.Coroutine已经被废弃了,而Boost.Coroutine2目前 ...
- BOOST.Asio——Tutorial
=================================版权声明================================= 版权声明:原创文章 谢绝转载 啥说的,鄙视那些无视版权随 ...
- boost:进程管理
概述 Boost.Process提供了一个灵活的C++ 进程管理框架.它允许C++ developer可以像Java和.Net程序developer那样管理进程.它还提供了管理当前执行进程上下文.创建 ...
- boost库在工作(36)网络服务端之六
在上面介绍了管理所有连接的类,这个类主要就是添加新的连接,或者删除不需要的连接.但是管理的类CAllConnect是没有办法知道什么时候添加,什么时候删除的,它需要从接收到连接类里获取得到新的连接,从 ...
- boost.ASIO-可能是下一代C++标准的网络库
曾几何时,Boost中有一个Socket库,但后来没有了下文,C++社区一直在翘首盼望一个标准网络库的出现,网络上开源的网络库也有不少,例如Apache Portable Runtime就是比较著名的 ...
- boost库在工作(37)网络UDP服务端之七
前面介绍的都是网络TCP的服务器和客户端,其实还有UDP的服务器和客户端,同时也有同步和异步之分.UDP与TCP最大的区别,就是TCP是基于连接的,而UDP是无连接的.这里所谓的连接是指对方中断服务时 ...
- boost库在工作(32)网络服务端之二
在这个例子里,服务器对象主要使用boost::asio::io_service对象,这个对象主要用来构造异步接收数据使用,接着定义boost::asio::ip::tcp::acceptor对象,这个 ...
随机推荐
- mac的jvm调优工具
安装好JDK之后调优工具所在位置为: /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/jvisualvm j ...
- 1206C Almost Equal
题目大意 给你一个n 让你用1~2*n的数填满一个2*n个点的环 使得任意连续的n个位置的和的最大值减最小值不大于1 分析 我们通过瞎jb找规律发现n为偶数吴姐 而n为奇数我们设前n个位置为0组,后n ...
- Linux学习篇(三)-Linux操作系统及常用命令
小知识:南桥北桥 北桥是高速总线控制器,在CPU附近,连接内存和CPU,需要传输大量数据. 南桥是低速总线控制器,用于连接IO设备(硬盘键盘鼠标等),IO设备由南桥汇总会直接传入北桥.,目前cpu可以 ...
- NuGet-Doc:NuGet.Server
ylbtech-NuGet-Doc:NuGet.Server 1.返回顶部 1. NuGet.Server 2018/03/13 NuGet.Server 是由 .NET Foundation 提供的 ...
- 测开之路六十四:UI测试平台之前端页面
{% extends "base.html" %} {% block script %} <!-- 引入js文件,需要在base.html留入口,不然渲染会出问题. --&g ...
- python web自动化测试框架搭建(功能&接口)——测试用例执行和结果收集
由于unittest框架中结果收集在不同文件中,所以此处重写结果收集方法,加入执行时间,失败信息,失败截图等 TestRunner.py # coding=utf-8 import sys impor ...
- 爬虫中GET方法应用基本模型
根据get方法,更改界面url从而获取信息 GET请求URL附带查询参数 POST请求保存在form表单中 分析百度贴吧url特点: 分析url https://tieba.baidu.com/f是贴 ...
- Orcle获取当前时间加小时
如下是oracle 获取当前数据库时间加2个小时 select to_date(TO_CHAR (SYSDATE, 'yyyy-mm-dd hh24:mi:ss'),'yyyy-mm-dd hh24: ...
- MySQL基础(查)
#新建一个表create database exercise; #查询表的信息SELECT * FROM student;SELECT * FROM score; #查询student表的第二条到第四 ...
- P2634 [国家集训队]聪聪可可(题解)(点分治)
P2634 [国家集训队]聪聪可可(题解)(点分治) 洛谷题目 #include<iostream> #include<cstdlib> #include<cstdio& ...