The C++ API should not rely on `unique_ptr`