some reusable C++11 functions and classes