#ifndef PYTHONIC_NUMPY_ASARRAY_HPP #define PYTHONIC_NUMPY_ASARRAY_HPP #include "pythonic/include/numpy/asarray.hpp" #include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/numpy/array.hpp" PYTHONIC_NS_BEGIN namespace numpy { template template auto _asarray::operator()(Types &&... args) -> decltype(array(std::forward(args)...)) { return array(std::forward(args)...); } template template F &&_asarray, T>::operator()(F &&a, dtype) { return std::forward(a); } template auto asarray(E &&e, types::none_type d) -> decltype( _asarray::type, typename types::dtype_of::type>::type>{}( std::forward(e))) { return _asarray< typename std::decay::type, typename types::dtype_of::type>::type>{}( std::forward(e)); } template auto asarray(E &&e, dtype d) -> decltype(_asarray::type, typename dtype::type>{}(std::forward(e), d)) { return _asarray::type, typename dtype::type>{}( std::forward(e), d); } } PYTHONIC_NS_END #endif