Commit 5fa57ec1 authored by Pierre Kraemer's avatar Pierre Kraemer

update foreach_dart functions

parent 20067814
......@@ -126,9 +126,13 @@ public:
/**
* Apply a functor on each dart of the map
* @param f a ref to the functor obj
* @param f a callable taking a Dart parameter
*/
bool foreach_dart(FunctorType& f) ;
template <typename FUNC>
void foreach_dart(FUNC f) ;
template <typename FUNC>
void foreach_dart(FUNC& f) ;
/****************************************
* SAVE & LOAD *
......
......@@ -228,7 +228,19 @@ inline void MapMono::next(Dart& d) const
m_attribs[DART].next(d.index) ;
}
inline bool MapMono::foreach_dart(FunctorType& f)
template <typename FUNC>
inline void MapMono::foreach_dart(FUNC f)
{
for (Dart d = begin(); d != end(); next(d))
{
if (f(d))
return true;
}
return false;
}
template <typename FUNC>
inline void MapMono::foreach_dart(FUNC& f)
{
for (Dart d = begin(); d != end(); next(d))
{
......
......@@ -280,9 +280,13 @@ public:
/**
* Apply a functor on each dart of the map
* @param f a ref to the functor obj
* @param f a callable taking a Dart parameter
*/
bool foreach_dart(FunctorType& f) ;
template <typename FUNC>
void foreach_dart(FUNC f) ;
template <typename FUNC>
void foreach_dart(FUNC& f) ;
/****************************************
* SAVE & LOAD *
......
......@@ -439,7 +439,19 @@ inline void MapMulti::next(Dart& d) const
d.index = m_mrattribs.end();
}
inline bool MapMulti::foreach_dart(FunctorType& f)
template <typename FUNC>
inline void MapMulti::foreach_dart(FUNC f)
{
for (Dart d = begin(); d != end(); next(d))
{
if (f(d))
return true;
}
return false;
}
template <typename FUNC>
inline void MapMulti::foreach_dart(FUNC& f)
{
for (Dart d = begin(); d != end(); next(d))
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment