implementation in c++11