Ported over to C++.

If boost doesn't work I'm gonna be so pissed.