Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace deprecated/removed C++98 binders by equivalent lambda express… #48

Merged
merged 1 commit into from
May 26, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions include/boost/container/string.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,11 @@ class basic_string
bool operator()(const typename Tr::char_type& x) const
{
return std::find_if(m_first, m_last,
#ifdef BOOST_NO_CXX98_BINDERS
[&](argument_type ch) { return Eq_traits<Tr>()(x, ch); }) == m_last;
#else
std::bind1st(Eq_traits<Tr>(), x)) == m_last;
#endif
}
};
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
Expand Down Expand Up @@ -2300,7 +2304,11 @@ class basic_string
pointer finish = addr + sz;
const const_iterator result =
std::find_if(addr + pos, finish,
#ifdef BOOST_NO_CXX98_BINDERS
[&](value_type ch) { return Eq_traits<Traits>()(ch, c); });
#else
std::bind2nd(Eq_traits<Traits>(), c));
#endif
return result != finish ? result - begin() : npos;
}
}
Expand Down Expand Up @@ -2372,7 +2380,11 @@ class basic_string
const const_iterator last = begin() + container_detail::min_value(len - 1, pos) + 1;
const_reverse_iterator rresult =
std::find_if(const_reverse_iterator(last), rend(),
#ifdef BOOST_NO_CXX98_BINDERS
[&](value_type ch) { return Eq_traits<Traits>()(ch, c); });
#else
std::bind2nd(Eq_traits<Traits>(), c));
#endif
return rresult != rend() ? (rresult.base() - 1) - begin() : npos;
}
}
Expand Down Expand Up @@ -2550,7 +2562,11 @@ class basic_string
const pointer finish = addr + this->priv_size();
const const_iterator result
= std::find_if(addr + pos, finish,
#ifdef BOOST_NO_CXX98_BINDERS
[&](value_type ch) { return !Eq_traits<Traits>()(ch, c); });
#else
std::not1(std::bind2nd(Eq_traits<Traits>(), c)));
#endif
return result != finish ? result - begin() : npos;
}
}
Expand Down Expand Up @@ -2617,7 +2633,11 @@ class basic_string
const const_iterator last = begin() + container_detail::min_value(len - 1, pos) + 1;
const const_reverse_iterator rresult =
std::find_if(const_reverse_iterator(last), rend(),
#ifdef BOOST_NO_CXX98_BINDERS
[&](value_type ch) { return !Eq_traits<Traits>()(ch, c); });
#else
std::not1(std::bind2nd(Eq_traits<Traits>(), c)));
#endif
return rresult != rend() ? (rresult.base() - 1) - begin() : npos;
}
}
Expand Down