Commit 39a03251 by Jonathan Wakely Committed by Jonathan Wakely

Add noexcept to various basic_string string operations

	* include/bits/basic_string.h (basic_string::find, basic_string::rfind)
	(basic_string::find_first_of, basic_string::find_last_of)
	(basic_string::find_first_not_of, basic_string::find_last_not_of):
	Make all overloads noexcept.
	(basic_string::compare(const _CharT*)): Make noexcept.

From-SVN: r243290
parent 3703d095
2016-12-06 Jonathan Wakely <jwakely@redhat.com>
* include/bits/basic_string.h (basic_string::find, basic_string::rfind)
(basic_string::find_first_of, basic_string::find_last_of)
(basic_string::find_first_not_of, basic_string::find_last_not_of):
Make all overloads noexcept.
(basic_string::compare(const _CharT*)): Make noexcept.
2016-12-03 John David Anglin <danglin@gcc.gnu.org>
* config/abi/post/hppa-linux-gnu/baseline_symbols.txt: Regenerate.
......
......@@ -1186,6 +1186,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
find(const _CharT* __s, size_type __pos, size_type __n) const
_GLIBCXX_NOEXCEPT
{
__glibcxx_requires_string_len(__s, __n);
const size_type __size = this->size();
......@@ -1227,6 +1228,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
rfind(const _CharT* __s, size_type __pos, size_type __n) const
_GLIBCXX_NOEXCEPT
{
__glibcxx_requires_string_len(__s, __n);
const size_type __size = this->size();
......@@ -1265,6 +1267,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
find_first_of(const _CharT* __s, size_type __pos, size_type __n) const
_GLIBCXX_NOEXCEPT
{
__glibcxx_requires_string_len(__s, __n);
for (; __n && __pos < this->size(); ++__pos)
......@@ -1280,6 +1283,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
find_last_of(const _CharT* __s, size_type __pos, size_type __n) const
_GLIBCXX_NOEXCEPT
{
__glibcxx_requires_string_len(__s, __n);
size_type __size = this->size();
......@@ -1301,6 +1305,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const
_GLIBCXX_NOEXCEPT
{
__glibcxx_requires_string_len(__s, __n);
for (; __pos < this->size(); ++__pos)
......@@ -1324,6 +1329,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const
_GLIBCXX_NOEXCEPT
{
__glibcxx_requires_string_len(__s, __n);
size_type __size = this->size();
......@@ -1397,7 +1403,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _CharT, typename _Traits, typename _Alloc>
int
basic_string<_CharT, _Traits, _Alloc>::
compare(const _CharT* __s) const
compare(const _CharT* __s) const _GLIBCXX_NOEXCEPT
{
__glibcxx_requires_string(__s);
const size_type __size = this->size();
......
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