22 #ifndef GEARS_FUNCTIONAL_ARITHMETIC_OPERATORS_HPP
23 #define GEARS_FUNCTIONAL_ARITHMETIC_OPERATORS_HPP
28 namespace functional {
30 template<
typename T,
typename U>
31 constexpr
auto operator()(T&& t, U&& u) const -> decltype(std::forward<T>(t) + std::forward<U>(u)) {
32 return std::forward<T>(t) + std::forward<U>(u);
37 template<
typename T,
typename U>
38 constexpr
auto operator()(T&& t, U&& u) const -> decltype(std::forward<T>(t) - std::forward<U>(u)) {
39 return std::forward<T>(t) - std::forward<U>(u);
43 struct multiplies_type {
44 template<
typename T,
typename U>
45 constexpr
auto operator()(T&& t, U&& u) const -> decltype(std::forward<T>(t) * std::forward<U>(u)) {
46 return std::forward<T>(t) * std::forward<U>(u);
51 template<
typename T,
typename U>
52 constexpr
auto operator()(T&& t, U&& u) const -> decltype(std::forward<T>(t) / std::forward<U>(u)) {
53 return std::forward<T>(t) / std::forward<U>(u);
58 template<
typename T,
typename U>
59 constexpr
auto operator()(T&& t, U&& u) const -> decltype(std::forward<T>(t) % std::forward<U>(u)) {
60 return std::forward<T>(t) % std::forward<U>(u);
76 constexpr plus_type
plus{};
136 #endif // GEARS_FUNCTIONAL_ARITHMETIC_OPERATORS_HPP