27 #ifndef MLN_CORE_CONCEPT_VALUE_SET_HH
28 # define MLN_CORE_CONCEPT_VALUE_SET_HH
34 # include <mln/core/concept/value_iterator.hh>
41 template <
typename E>
struct Value_Set;
45 struct Value_Set<void>
47 typedef Object<void> super;
57 struct Value_Set :
public Object<E>
59 typedef Value_Set<void> category;
80 std::ostream& operator<<(std::ostream& ostr, const Value_Set<E>& vs);
83 # ifndef MLN_INCLUDE_ONLY
87 Value_Set<E>::Value_Set()
89 typedef mln_value(E) value;
90 typedef mln_fwd_viter(E) fwd_viter;
91 typedef mln_bkd_viter(E) bkd_viter;
93 bool (E::*m1)(const value&) const = & E::has;
95 value (E::*m2)(
unsigned) const = & E::operator[];
97 unsigned (E::*m3)() const = & E::nvalues;
101 template <typename E>
103 std::ostream& operator<<(std::ostream& ostr, const Value_Set<E>& vs_)
105 const E& vs = exact(vs_);
107 for (
unsigned i = 0; i < vs.nvalues(); ++i)
108 ostr << vs[i] <<
' ';
112 # endif // ! MLN_INCLUDE_ONLY
117 #endif // ! MLN_CORE_CONCEPT_VALUE_SET_HH