26 #ifndef MLN_VALUE_INTERNAL_ITERABLE_SET_HH
27 # define MLN_VALUE_INTERNAL_ITERABLE_SET_HH
34 # include <mln/core/concept/value_set.hh>
35 # include <mln/trait/value_.hh>
36 # include <mln/value/builtin/all.hh>
37 # include <mln/value/internal/convert.hh>
47 template <
typename S>
struct fwd_viter_;
48 template <
typename S>
struct bkd_viter_;
57 template <
typename T,
typename E>
58 struct iterable_set :
public Value_Set<E>
64 typedef fwd_viter_<E> fwd_viter;
67 typedef bkd_viter_<E> bkd_viter;
70 bool has(
const T& v)
const;
73 T operator[](
unsigned i)
const;
76 unsigned index_of(
const T& v)
const;
79 unsigned nvalues()
const;
85 # ifndef MLN_INCLUDE_ONLY
87 template <
typename T,
typename E>
90 iterable_set<T,E>::has(
const T&)
const
95 template <
typename T,
typename E>
98 iterable_set<T,E>::operator[](
unsigned i)
const
100 mln_precondition(i < nvalues());
101 return mln::value::internal::convert_<T>::value_at_index(i);
104 template <
typename T,
typename E>
107 iterable_set<T,E>::index_of(
const T& v)
const
109 return mln::value::internal::convert_<T>::index_of_value(v);
112 template <
typename T,
typename E>
115 iterable_set<T,E>::nvalues()
const
120 # endif // ! MLN_INCLUDE_ONLY
129 # include <mln/value/viter.hh>
132 #endif // ! MLN_VALUE_INTERNAL_ITERABLE_SET_HH