26 #ifndef MLN_VALUE_OTHER_HH
27 # define MLN_VALUE_OTHER_HH
34 # include <mln/core/concept/value.hh>
35 # include <mln/value/set.hh>
36 # include <mln/value/concept/all.hh>
48 V
other(
const V& val);
52 # ifndef MLN_INCLUDE_ONLY
59 other_(
const void*,
const V& val)
66 other_(
const void*,
const bool& val)
75 other_(mln::trait::value::quant::high,
const Value<V>& val_)
77 const V& val =
exact(val_);
84 other_(mln::trait::value::quant::high,
const value::Scalar<V>& val_)
86 const V& val =
exact(val_);
87 return (mln_max(V) - val) + mln_min(V);
93 other_(mln::trait::value::quant::low,
const Value<V>& val_)
95 const V& val =
exact(val_);
97 unsigned i = s.index_of(val);
98 mln_assertion(s.nvalues() >= 2);
99 return i == 0 ? s[1] : s[0];
102 template <
typename V>
105 other_(
const Value<V>*,
const V& val)
107 return other_(mln_trait_value_quant(V)(), val);
113 template <
typename V>
115 V
other(
const V& val)
117 V tmp = internal::other_(&val, val);
118 mln_postcondition(tmp != val);
122 # endif // ! MLN_INCLUDE_ONLY
129 #endif // ! MLN_VALUE_OTHER_HH