c++11 and more error checking