C++11特性:
一、右值引用,move
二、泛化的常數表示,constexpr
三、外部模板,extern
四、初始化列表,std::initializer_list<>
五、統一的初始化,{}
六、類型推導,auto,decltype
七、範圍for循環,for(auto x: list)
八、lambda表達式,[=,&,x,&x](){}
九、返回值推導函數語法,template<typename LHS, typename RHS>
auto AddingFunc(const LHS& lhs, const RHS& rhs) -> decltype(lhs+rhs) { return lhs + rhs; }
十、構造函數複用(委託|轉接),SomeType(int i, string& s):num(i), name(s) {}
SomeType():SomeType(0, "invalid"){}
SomeType(int i): SomeType(i, "guest"){}
十一、虛函數重載限定符號,override(派生),final(禁止派生)
十二、空指針,nullptr
1三、強類型枚舉,enum EM1:unsigned int {},enum class EM2:unsigned int {}
1四、角括號,std::vector<SomeType<(1>2)>>,不解析爲右移
1五、顯式轉換限定,explicit
1六、模板別名,using,template<typename second>
using TypedefName = SomeType<OtherType, second, 5>
using PFD = void(*)(double)
1七、變長參數模板,template<typename ... Args>
void print(const char* s, T value, Args... args);
1八、編譯器支持unicode,char16_t,char32_t,u8|u|U|R
1九、thread_local
20、是用或禁用默認函數,SomeType() = default; SomeType(const SomeType&) = delete;
2一、static_assert
2二、sizeof支持對象成員
2三、線程支持:std::thread,std::mutex,std::recursive_mutex,std::condition_variable,std::condition_variable_any,std::lock_guard,std::unique_lock http://www.cnblogs.com/haippy/p/3284540.html
2四、元組,tuple
2五、散列表,unordered_set|unordered_multiset|unordered_map|unordered_multimap
2六、正則表達式,regex
2七、通用智能指針,shared_ptr
2八、擴展隨機數:
隨機數算法:linear_congruential|subtract_with_carry|mersenne_twister
標準分佈:uniform_int_distribution(離散型均勻分佈) bernoulli_distribution(伯努利分佈) geometric_distribution(幾何分佈) poisson_distribution(卜瓦松分佈)
binomial_distribution(二項分佈) uniform_real_distribution(離散型均勻分佈) exponential_distribution(指數分佈) normal_distribution(正態分佈)
gamma_distribution(伽瑪分佈)
示例: std::uniform_int_distribution<int> distribution(0, 99);
std::mt19937 engine;
auto generator = std::bind(distribution, engine);
int random = generator();
2九、包裝引用,std::ref
30、多態函數對象包裝器:std::function std::plus std::ref(car) Test car;
3一、std::unique_ptr std::auto_ptr std::shared_ptrhtml