This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Add noexcept to shared_ptr owner comparisons (LWG 2873)


C++17 requires these to be noexcept, and there's no reason not to do
it for earlier standard modes too.

	* include/bits/shared_ptr_base.h (__shared_ptr::owner_before)
	(__weak_ptr::owner_before, _Sp_owner_less::operator()): Add noexcept
	specifiers as per LWG 2873 and LWG 2942.
	* testsuite/20_util/owner_less/noexcept.cc: New.
	* testsuite/20_util/shared_ptr/observers/owner_before.cc: Test
	noexcept guarantees.
	* testsuite/20_util/weak_ptr/observers/owner_before.cc: Likewise.

Tested powerpc64le-linux, committed to trunk.

Attachment: patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]