c++11 - the new standard auto and init list for (const auto x : { 1, 2, 3}}) cout << x << endl; In-class member initializers class A { public: int a = 0xff; }; class A { public: A() {} private: hashingFunction hash_algorithm{"MD5"}; std::string s{"Contructor run"}; }; swap - use rvalue-reference tempalte <typename T> void swap(T& a, T& b) { T tmp = std::move(a); a = std::move(b); b = std::move(tmp); } memory - pointers // unique_ptr X* f() { unique_ptr<X> ptr(new X()); // do something - maybe throw an exception return ptr.release(); } unique_ptr<X> f() { unique_ptr<X> ptr(new X()); // ... return ptr; }