CPlusPlusThings/c++2.0
Light-City 76bf5b96cc update
2019-11-05 17:31:14 +08:00
..
variadic update 2019-11-05 17:27:32 +08:00
alias.cpp update 2019-11-05 17:27:32 +08:00
auto.cpp update 2019-11-05 17:27:32 +08:00
constexpr.cpp update 2019-11-05 17:27:32 +08:00
decltype.cpp update 2019-11-05 17:27:32 +08:00
default_delete.cpp update 2019-11-05 17:27:32 +08:00
explicit.cpp update 2019-11-05 17:27:32 +08:00
final.cpp update 2019-11-05 17:27:32 +08:00
hash.cpp update 2019-11-05 17:27:32 +08:00
initializer.cpp update 2019-11-05 17:27:32 +08:00
lambda.cpp update 2019-11-05 17:27:32 +08:00
move.cpp update 2019-11-05 17:27:32 +08:00
noexcept.cpp update 2019-11-05 17:27:32 +08:00
nullptr.cpp update 2019-11-05 17:27:32 +08:00
override.cpp update 2019-11-05 17:27:32 +08:00
README.md update 2019-11-05 17:31:14 +08:00
rvalue.cpp update 2019-11-05 17:27:32 +08:00
template_template.cpp update 2019-11-05 17:27:32 +08:00
tuple.cpp update 2019-11-05 17:27:32 +08:00
type_alias.cpp update 2019-11-05 17:27:32 +08:00
uniform_initialization.cpp update 2019-11-05 17:27:32 +08:00

C++ 2.0新特性

vector<list<int> > //ok in each C++ version
vector<list<int>> // before c++ 11 error error: >> should be > > within a nested template argument list,c++11后可以正常通过
for(decl:col) {
    statement
}
  • =default,=delete

    如果你自行定义了一个ctor,那么编译器就不会给你一个default ctor 如果强制加上=default,就可以重新获得并使用default ctor.

  • Alias(化名)Template(template typedef)

alias.cpp

template_template.cpp

(1) 序列式容器包括array(C++2.0新引入),vector,deque,list,forward_list(C++2.0新引入)

(2) 关联式容器包括set/multiset,map/multimap

(3) 无序容器(C++2.0新引入,更换原先hash_xxx为unordered_xxx)包括unordered_map/unordered_multimap,unordered_set/unordered_multiset

学习自侯捷C++11标准