add algorithm::for_each
parent
c4aa7242fc
commit
6d60b051e8
|
@ -10,6 +10,7 @@
|
|||
|
||||
#include "octa/functional.h"
|
||||
#include "octa/range.h"
|
||||
#include "octa/utility.h"
|
||||
|
||||
namespace octa {
|
||||
template<typename R, typename U>
|
||||
|
@ -200,6 +201,13 @@ namespace octa {
|
|||
return max_element(PointerRange<const T>(il.get(),
|
||||
il.get() + il.length(), compare)).first();
|
||||
}
|
||||
|
||||
template<typename R, typename F>
|
||||
F for_each(R range, F func) {
|
||||
for (; !range.empty(); range.pop_first())
|
||||
func(range.first());
|
||||
return move(func);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue