C++ Implementation of equity