cpp impl