Rewriting (at least some) of GHOST in C++