#ifndef PYTHONIC_INCLUDE_NUMPY_NDARRAY_TOLIST_HPP #define PYTHONIC_INCLUDE_NUMPY_NDARRAY_TOLIST_HPP #include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_conversion.hpp" #include "pythonic/types/ndarray.hpp" PYTHONIC_NS_BEGIN namespace numpy { namespace ndarray { template struct tolist_type { using type = types::list::type>; }; template struct tolist_type { using type = types::list; }; template typename std::enable_if::value == 1, types::list>::type tolist(types::ndarray const &expr); template typename std::enable_if< std::tuple_size::value != 1, typename tolist_type::value>::type>::type tolist(types::ndarray const &expr); NUMPY_EXPR_TO_NDARRAY0_DECL(tolist); DEFINE_FUNCTOR(pythonic::numpy::ndarray, tolist); } } PYTHONIC_NS_END #endif