26 #ifndef MLN_VALUE_SIGN_HH
27 # define MLN_VALUE_SIGN_HH
33 # include <mln/value/internal/integer.hh>
34 # include <mln/trait/value_.hh>
35 # include <mln/literal/zero.hh>
36 # include <mln/literal/one.hh>
37 # include <mln/debug/format.hh>
49 class sign :
public internal::Integer<sign>
81 sign& operator=(
int i);
103 std::ostream& operator<<(std::ostream& ostr,
const sign& i);
106 bool operator==(
const sign& lhs,
const sign& rhs);
107 bool operator<(
const sign& lhs,
const sign& rhs);
109 # ifndef MLN_INCLUDE_ONLY
111 # ifndef MLN_WO_GLOBAL_VARS
116 # endif // !MLN_WO_GLOBAL_VARS
124 sign::operator int()
const
139 mln_precondition(i >= -1);
140 mln_precondition(i <= 1);
146 sign::operator=(
int i)
148 mln_precondition(i >= -1);
149 mln_precondition(i <= 1);
184 std::ostream& operator<<(std::ostream& ostr,
const sign& i)
192 return lhs.val_() == rhs.val_();
196 bool operator<(
const sign& lhs,
const sign& rhs)
198 return lhs.val_() == rhs.val_();
201 # endif // ! MLN_INCLUDE_ONLY
209 struct value_<mln::value::sign>
218 typedef trait::value::nature::integer nature;
219 typedef trait::value::kind::gray kind;
220 typedef trait::value::quant::low quant;
236 #endif // ! MLN_VALUE_SIGN_HH