compiles with g++
base of cpp version