C++ version of bcplib