56 using base_t =
typename U::base_type;
60 template <typename Up = Tp, enable_if_t<has_data<Up>::value,
char> = 0>
65 sfinae(obj, 0, 0, rhs);
68 template <typename Vt, typename Up = Tp, enable_if_t<!has_data<Up>::value,
char> = 0>
73 template <
typename Up>
74 auto sfinae(
Up& obj,
int,
int,
const Up& rhs)
76 static_cast<base_t<Up>&
>(rhs)),
79 static_cast<base_t<Up>&
>(obj).
plus(
crtp::base{},
static_cast<base_t<Up>&
>(rhs));
83 auto sfinae(U& obj,
int,
long,
const U& rhs) ->
decltype(obj.plus(rhs), void())
89 auto sfinae(U&,
long,
long,
const U&)
102template <
typename Tp>
107 template <
typename U>
112 template <typename Up = Tp, enable_if_t<has_data<Up>::value,
char> = 0>
117 sfinae(obj, 0, 0, rhs);
120 template <typename Vt, typename Up = Tp, enable_if_t<!has_data<Up>::value,
char> = 0>
125 template <
typename Up>
126 auto sfinae(
Up& obj,
int,
int,
const Up& rhs)
128 static_cast<base_t<Up>&
>(rhs)),
131 static_cast<base_t<Up>&
>(obj).
minus(
crtp::base{},
static_cast<base_t<Up>&
>(rhs));
134 template <
typename U>
135 auto sfinae(U& obj,
int,
long,
const U& rhs) ->
decltype(obj.minus(rhs), void())
140 template <
typename U>
141 auto sfinae(U&,
long,
long,
const U&)
154template <
typename Tp>
161 template <typename Up = Tp, enable_if_t<has_data<Up>::value,
char> = 0>
168 template <typename Up = Tp, enable_if_t<has_data<Up>::value,
char> = 0>
175 template <typename Vt, typename Up = Tp, enable_if_t<!has_data<Up>::value,
char> = 0>
189template <
typename Tp>
196 template <typename Up = Tp, enable_if_t<has_data<Up>::value,
char> = 0>
203 template <typename Up = Tp, enable_if_t<has_data<Up>::value,
char> = 0>
210 template <typename Vt, typename Up = Tp, enable_if_t<!has_data<Up>::value,
char> = 0>
a generic type for prioritizing a function call to the base class over derived functions,...
Tp & plus(Tp &, const Up &)
auto divide(Tp &_lhs, Up _rhs, type_list<>,...) -> decltype(_lhs/=_rhs, void())
Tp & minus(Tp &, const Up &)
Tp & multiply(Tp &, const Up &)
the namespace is provided to hide stl overload from global namespace but provide a method of using th...
The declaration for the types for operations without definitions.
Include the macros for operations.
Declare the operations types.
This operation class is used for division of a component.
TIMEMORY_DELETED_OBJECT(divide) template< typename Up
Define subtraction operations.
TIMEMORY_DELETED_OBJECT(minus) template< typename Up
typename U::base_type base_t
This operation class is used for multiplication of a component.
TIMEMORY_DELETED_OBJECT(multiply) template< typename Up
Define addition operations.
TIMEMORY_DELETED_OBJECT(plus) template< typename Up
typename U::base_type base_t