[patch] Add exception specs to allocator equality operators
Jonathan Wakely
jwakely@redhat.com
Mon Apr 14 15:13:00 GMT 2014
The equality operators for std::allocator were throw() in C++03 and
are noexcept in C++11, but we were missing those specs (and the
problem wasn't caught by the testsuite because of PR50871).
Tested x86_64-linux, committed to trunk.
-------------- next part --------------
commit 3043f742f7f31504dd881b55eaf6abaf73d79380
Author: Jonathan Wakely <accu@kayari.org>
Date: Mon Apr 14 15:55:34 2014 +0100
* include/bits/allocator.h (operator==, operator!=): Add exception
specifications.
diff --git a/libstdc++-v3/include/bits/allocator.h b/libstdc++-v3/include/bits/allocator.h
index e293c54..05a06ba 100644
--- a/libstdc++-v3/include/bits/allocator.h
+++ b/libstdc++-v3/include/bits/allocator.h
@@ -126,21 +126,25 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _T1, typename _T2>
inline bool
operator==(const allocator<_T1>&, const allocator<_T2>&)
+ _GLIBCXX_USE_NOEXCEPT
{ return true; }
template<typename _Tp>
inline bool
operator==(const allocator<_Tp>&, const allocator<_Tp>&)
+ _GLIBCXX_USE_NOEXCEPT
{ return true; }
template<typename _T1, typename _T2>
inline bool
operator!=(const allocator<_T1>&, const allocator<_T2>&)
+ _GLIBCXX_USE_NOEXCEPT
{ return false; }
template<typename _Tp>
inline bool
operator!=(const allocator<_Tp>&, const allocator<_Tp>&)
+ _GLIBCXX_USE_NOEXCEPT
{ return false; }
/// @} group allocator
More information about the Libstdc++
mailing list