C++ (Boost) port of x2