Implemantion in c++