27 #ifndef MLN_VALUE_MIXIN_HH
28 # define MLN_VALUE_MIXIN_HH
30 # include <mln/core/concept/function.hh>
31 # include <mln/core/concept/image.hh>
32 # include <mln/value/internal/value_like.hh>
39 template <
typename T,
typename F>
46 template <
typename T,
typename F>
47 struct value_< mln::value::mixin<T, F> >
52 static const F f = F();
63 template <
typename T,
typename F>
77 mixin(
const mixin& rhs)
82 mixin& operator=(
const mixin& rhs)
85 this->T::operator=(rhs);
89 mixin& operator=(
const T& t)
92 this->T::operator=(t);
100 template <
typename T,
typename F>
101 bool operator < (const value::mixin<T,F>& lhs,
const value::mixin<T,F>& rhs)
104 return f.less(lhs, rhs);
116 template <
typename T,
typename F>
117 bool operator == (
const value::mixin<T,F>& lhs,
const value::mixin<T,F>& rhs)
120 return !(f.less(lhs, rhs) || f.less(rhs, lhs));
123 template <
typename T,
typename F>
124 bool operator <= (const value::mixin<T,F>& lhs,
const value::mixin<T,F>& rhs)
127 return f.less(lhs, rhs) || lhs == rhs;
130 template <
typename T,
typename F>
131 bool operator > (
const value::mixin<T,F>& lhs,
const value::mixin<T,F>& rhs)
134 return ! (f.less(lhs, rhs) || lhs == rhs);
137 template <
typename T,
typename F>
138 bool operator >= (
const value::mixin<T,F>& lhs,
const value::mixin<T,F>& rhs)
141 return ! f.less(lhs, rhs);
144 # ifndef MLN_INCLUDE_ONLY
146 # endif // MLN_INCLUDE_ONLY
150 #endif // ! MLN_VALUE_MIXIN_HH