C++ implementation
C++ implementation