Effective Modern C++ | Scott Meyers

Scott Meyers; Effective Modern C++: 42 Specific Ways to Improve Your Use of C++11 and C++14; O’Reilly Media; 1st edition; 2014-12-04; 320 pages; kindle: no, paper: $41.


Related

Scott Meyers; Effective Modern C++; At NDC on Vimeo; 2014; 1:00:??.

Mentions

  • Prefer auto, for a variety of reasons
  • Whereas
    • int (int unsigned) is 32 bits
    • std::size_t is always 64 bits
  • Closures might or might not use heap storage depending upon how many objects are captured.  The auto variant will be inlined & on the stack.

    • std::function<int (int)> = fla = [=](int x) { ... }
    • auto = fla = [=](int x) { ... }
  • A braced initializer does not have a t ype, but deduces to std::initializer_list<TYPE> mostly.
  • Proxy types, hidden proxy types (so you want to use auto)
    • ! std::is_same<std::vector<bool>::reference *, type *>::value
  • Uniform Initialization (mostly) can be done with brace initialization
    • disallows narrowing conversions
    • different rules for constructor overloading matches in the presence of std::initializer_list<TYPE>.
  • Atomic Data versus Transactions (mutexes)
    • bitwise const or internal synchronization
    • standard discipline for multithreaded design applies

Actualities

ol>