Added C++ compatibility