NPRPC docs

function narrow

C++

template <class T> requires (std::is_base_of_v<Object, T>) T *narrow(Object *&obj) noexcept

Converts a generic Object to the proxy type T of its interface.

On success obj is consumed (set to nullptr) and the new proxy returned. Returns nullptr, leaving obj alone, if the object does not implement T's interface.

include/nprpc/nprpc.hpp:1152