Make string_view operations involving CharT* *not* noexcept and consistent beween string_view and string_view.tcc.

Ed Smith-Rowland 3dw4rd@verizon.net
Sat Mar 29 18:54:00 GMT 2014


All,

In string_view I botched the noexcept specification of operations like 
find and friends with CharT* arguments.

I'm a little surprised the inconsistency between string_view and 
string_view.tcc didn't error.  In fact, in one repo thats a little 
behind trunk it does.  I'll continue to look after that issue separately.

Built and tested clean on x86_64-linux.  OK?

Ed

-------------- next part --------------
2014-03-29  Ed Smith-Rowland  <3dw4rd@verizon.net>

	Make string_view operations involving CharT* *not* noexcept
	and consistent beween string_view and string_view.tcc.
	string_view (find(const _CharT*, size_type)): Remove noexcept.
	(rfind(const _CharT*, size_type)): Ditto.
	(find_first_of(const _CharT*, size_type)): Ditto.
	(find_last_of(const _CharT*, size_type)): Ditto.
	(find_first_not_of(const _CharT*, size_type)): Ditto.
	(find_last_not_of(const _CharT*, size_type)): Ditto.
	string_view.tcc (find(const _CharT*, size_type, size_type)):
	Remove noexcept.
	(rfind(const _CharT*, size_type, size_type)): Ditto.
-------------- next part --------------
Index: include/experimental/string_view
===================================================================
--- include/experimental/string_view	(revision 208894)
+++ include/experimental/string_view	(working copy)
@@ -332,7 +332,7 @@
       find(const _CharT* __str, size_type __pos, size_type __n) const;
 
       size_type
-      find(const _CharT* __str, size_type __pos=0) const noexcept
+      find(const _CharT* __str, size_type __pos=0) const
       { return this->find(__str, __pos, traits_type::length(__str)); }
 
       size_type
@@ -346,7 +346,7 @@
       rfind(const _CharT* __str, size_type __pos, size_type __n) const;
 
       size_type
-      rfind(const _CharT* __str, size_type __pos = npos) const noexcept
+      rfind(const _CharT* __str, size_type __pos = npos) const
       { return this->rfind(__str, __pos, traits_type::length(__str)); }
 
       size_type
@@ -361,7 +361,7 @@
       find_first_of(const _CharT* __str, size_type __pos, size_type __n) const;
 
       size_type
-      find_first_of(const _CharT* __str, size_type __pos = 0) const noexcept
+      find_first_of(const _CharT* __str, size_type __pos = 0) const
       { return this->find_first_of(__str, __pos, traits_type::length(__str)); }
 
       size_type
@@ -377,7 +377,7 @@
       find_last_of(const _CharT* __str, size_type __pos, size_type __n) const;
 
       size_type
-      find_last_of(const _CharT* __str, size_type __pos = npos) const noexcept
+      find_last_of(const _CharT* __str, size_type __pos = npos) const
       { return this->find_last_of(__str, __pos, traits_type::length(__str)); }
 
       size_type
@@ -393,7 +393,7 @@
 			size_type __pos, size_type __n) const;
 
       size_type
-      find_first_not_of(const _CharT* __str, size_type __pos = 0) const noexcept
+      find_first_not_of(const _CharT* __str, size_type __pos = 0) const
       {
 	return this->find_first_not_of(__str, __pos,
 				       traits_type::length(__str));
@@ -412,8 +412,7 @@
 		       size_type __pos, size_type __n) const;
 
       size_type
-      find_last_not_of(const _CharT* __str,
-		       size_type __pos = npos) const noexcept
+      find_last_not_of(const _CharT* __str, size_type __pos = npos) const
       {
 	return this->find_last_not_of(__str, __pos,
 				      traits_type::length(__str));
Index: include/experimental/string_view.tcc
===================================================================
--- include/experimental/string_view.tcc	(revision 208894)
+++ include/experimental/string_view.tcc	(working copy)
@@ -53,7 +53,7 @@
   template<typename _CharT, typename _Traits>
     typename basic_string_view<_CharT, _Traits>::size_type
     basic_string_view<_CharT, _Traits>::
-    find(const _CharT* __str, size_type __pos, size_type __n) const noexcept
+    find(const _CharT* __str, size_type __pos, size_type __n) const
     {
       __glibcxx_requires_string_len(__str, __n);
 
@@ -90,7 +90,7 @@
   template<typename _CharT, typename _Traits>
     typename basic_string_view<_CharT, _Traits>::size_type
     basic_string_view<_CharT, _Traits>::
-    rfind(const _CharT* __str, size_type __pos, size_type __n) const noexcept
+    rfind(const _CharT* __str, size_type __pos, size_type __n) const
     {
       __glibcxx_requires_string_len(__str, __n);
 


More information about the Libstdc++ mailing list