Download - C++11 - STL Additions

Transcript
  • 1. STL additions

2. Uniform initialization syntaxMove semanticNew methodsNew containersstd::tuple 3. Very common code:for (set >::const_iterator thread =clientThreads.begin();thread != clientThreads.end(); thread++){/* ... */}Allow compiler to deduce type:for (auto thread = clientThreads.begin();thread != clientThreads.end(); ++thread){/* ... */} 4. Simplify iteration for standard containers:int v[] { 1, -4, 11 };for (int& i: v) { // for ( auto& i : v )i += 42;}for (int i: v) { // for ( auto i : v )cout