Replace boost::next with a simpler version

Less optimized, but hopefully it won't cause any warnings.
This commit is contained in:
Daniel James
2016-10-11 13:36:41 +01:00
parent a316d3fa46
commit 74abdd6973
5 changed files with 47 additions and 35 deletions

View File

@@ -38,6 +38,26 @@ namespace test
{
return get_key_impl<Container>::get_key(x);
}
// test::next
//
// Increments an iterator by 1 or a given value.
// Like boost::next, but simpler and slower.
template <typename Iterator>
Iterator next(Iterator it)
{
return ++it;
}
template <typename Iterator, typename IntType>
Iterator next(Iterator it, IntType x)
{
for(; x > 0; --x) {
++it;
}
return it;
}
}
#endif