Java to C++ advice?