#ifndef PYTHONIC_OPERATOR_MUL_HPP #define PYTHONIC_OPERATOR_MUL_HPP #include "pythonic/include/operator_/mul.hpp" #include "pythonic/utils/functor.hpp" #include "pythonic/operator_/overloads.hpp" PYTHONIC_NS_BEGIN namespace operator_ { template auto mul(A &&a, B &&b) -> decltype(std::forward(a) * std::forward(b)) { return std::forward(a) * std::forward(b); } DEFINE_ALL_OPERATOR_OVERLOADS_IMPL( mul, *, (b == 0 || (a * b >= 0 && std::abs(a) <= std::numeric_limits::max() / std::abs(b)) || (a * b <= 0 && std::abs(a) >= std::numeric_limits::min() / std::abs(b)))) } PYTHONIC_NS_END #endif