![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++新特性
ox0080
surprise
展开
-
Seastar- complete tutorial (3)
Seastar 是一个 c + + 库,用于在现代多核机器上编写高效的复杂服务器应用程序。传统上,用于编写服务器应用程序的编程语言库和框架被划分为两个不同的阵营: 注重效率的阵营和注重复杂性的阵营。 有些框架非常高效,但是只允许构建简单的应用程序(例如,DPDK 允许单独处理数据包的应用程序) ,而其他框架允许构建极其复杂的应用程序,代价是运行时效率。 Seastar 是我们两全其美的尝试: 创...原创 2019-11-29 11:50:01 · 412 阅读 · 0 评论 -
Seatsar mini-tutorial(2)
Future and promiseA future is a result of a computation that may not be available yet. Examples include:未来是计算的结果,可能尚未可用,例如:a data buffer that we are reading from the network 我们从网络中读取的数据缓冲区the expi...原创 2019-11-29 11:41:57 · 125 阅读 · 0 评论 -
Seastar-Basic knowledge(1)
SeaStar is an event-driven framework allowing you to write non-blocking, asynchronouscode in a relatively straightforward manner (once understood). It is based on futures.原创 2019-11-29 11:38:13 · 142 阅读 · 0 评论 -
移动语义与右值引用
新特性的目的右值引用 (Rvalue Referene) 是 C++ 新标准 (C++11, 11 代表 2011 年 ) 中引入的新特性 , 它实现了转移语义 (Move Sementics) 和精确传递 (Perfect Forwarding)。它的主要目的有两个方面:消除两个对象交互时不必要的对象拷贝,节省运算存储资源,提高效率。 能够更简洁明确地定义泛型函数。左值与右值的定义...翻译 2019-07-22 15:01:45 · 86 阅读 · 0 评论 -
深度剖析右值引用
#include <iostream>#include <vector>#include <cstring>#include <cstdlib>class MyString { private: char* _data; size_t _len; void _init_data(const char *s) { st...原创 2019-07-22 17:48:52 · 119 阅读 · 0 评论 -
C++新特性学习
1 容器库1.1 std::array定义于头文件 <array>template< class T, std::size_t N > struct array;std::array 是std::vector的一个弱化,是封装固定大小数组的容器。在初始化时就必须指定大小,且不会动态增长;其分配的空间是栈上的数组,而不是堆上。eg1...原创 2019-07-23 10:26:05 · 798 阅读 · 0 评论