added C++ version of xFrom*