g++/clang++ compatible version of code