一、类型与变量相关
1、nullptr:
取代了NULL,专用与空指针。
2、constexpr,暂不care
3、using取代typedef:
typdef double db //c99
using db = double //c11
typedef void* (*func)(int ,int); //c99
using func = void* (int,int); //c11
4、字符串和数值类型的转换
以前的atoi,itoa,stoi,stol,stoul,stoll,stoull等成为历史。
5、原子变量
std::stomia<XXX>
用户多线程资源互斥操作,属C++11重大提升,多线程原子操作简单了许多。
基于C++11实现的无锁队列,让boost的lockfree无锁队列也称为历史。
6、正则表达式
std::regex
C正则(regex.h)和boost正则成为历史。
7、string的数值转换函数
| 函数 | 描述 |
|---|---|
| to_string(val) | 返回任意算术类型val的字符串 |
| stoi(s, p, b) | int类型 |
| stol(s, p, b) | long类型 |
| stoul(s, p, b) | unsigned long类型 |
| stoll(s, p, b) | long long类型 |
| stoull(s, p, b) | unsigned long long类型 |
| stof(s, p, b) | float类型 |
| stod(s, p, b) | double类型 |
| stold(s, p, b) | long double类型 |
8、lambda表达式
715

被折叠的 条评论
为什么被折叠?



