Move to std::next instead of homebrewed function
This commit is contained in:
@@ -137,13 +137,6 @@ namespace chaiscript {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
template<typename Iter, typename Distance>
|
|
||||||
Iter advance_copy(Iter iter, Distance distance) {
|
|
||||||
std::advance(iter, static_cast<typename std::iterator_traits<Iter>::difference_type>(distance));
|
|
||||||
return iter;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
auto parse_num(const char *t_str) -> typename std::enable_if<std::is_integral<T>::value, T>::type
|
auto parse_num(const char *t_str) -> typename std::enable_if<std::is_integral<T>::value, T>::type
|
||||||
{
|
{
|
||||||
|
@@ -1410,7 +1410,7 @@ namespace chaiscript
|
|||||||
static typename Container::const_iterator find_keyed_value(const Container &t_c, const Key &t_key, const size_t t_hint)
|
static typename Container::const_iterator find_keyed_value(const Container &t_c, const Key &t_key, const size_t t_hint)
|
||||||
{
|
{
|
||||||
if (t_c.size() > t_hint && t_c[t_hint].first == t_key) {
|
if (t_c.size() > t_hint && t_c[t_hint].first == t_key) {
|
||||||
return advance_copy(t_c.begin(), t_hint);
|
return std::next(t_c.begin(), t_hint);
|
||||||
} else {
|
} else {
|
||||||
return find_keyed_value(t_c, t_key);
|
return find_keyed_value(t_c, t_key);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user