26 #ifndef MLN_UTIL_INTERNAL_ID2ELEMENT_HH
27 # define MLN_UTIL_INTERNAL_ID2ELEMENT_HH
33 #include <mln/core/concept/graph.hh>
34 #include <mln/core/concept/function.hh>
45 template <
typename G,
typename Elt>
46 struct id2element : Function_v2v< id2element<G,Elt> >
51 id2element(
const Graph<G>& g);
52 Elt operator()(
unsigned id)
const;
58 # ifndef MLN_INCLUDE_ONLY
60 template <
typename G,
typename Elt>
62 id2element<G,Elt>::id2element()
66 template <
typename G,
typename Elt>
68 id2element<G,Elt>::id2element(
const Graph<G>& g)
73 template <
typename G,
typename Elt>
76 id2element<G,Elt>::operator()(
unsigned id)
const
78 mln_assertion(g_.is_valid());
79 mln_assertion(g_.has(Elt(g_,
id)));
87 # endif // ! MLN_INCLUDE_ONLY
97 #endif // ! MLN_UTIL_INTERNAL_ID2ELEMENT_HH