I have a C++ class which is interchangeable with Numpy arrays through the buffer protocol, and already I can return objects from C++ to Python which are convertible to Numpy via the numpy.asarray() call.
I would like to make my class even easier to use, so I would like to return Numpy arrays which wrap my class directly from C++.
Is it possible to construct a numpy array from the C++ side using PyBind11 and return it?