From 9ed9f43ca83ee2a2cc4eed3708e502f26362803d Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 1 Jun 2020 03:53:21 +0300 Subject: [PATCH] Document owner_less, owner_equal_to --- doc/smart_ptr.adoc | 21 ++----------- doc/smart_ptr/changelog.adoc | 1 + doc/smart_ptr/owner_equal_to.adoc | 45 ++++++++++++++++++++++++++++ doc/smart_ptr/owner_less.adoc | 50 +++++++++++++++++++++++++++++++ 4 files changed, 99 insertions(+), 18 deletions(-) create mode 100644 doc/smart_ptr/owner_equal_to.adoc create mode 100644 doc/smart_ptr/owner_less.adoc diff --git a/doc/smart_ptr.adoc b/doc/smart_ptr.adoc index 69051c7..23dc5e5 100644 --- a/doc/smart_ptr.adoc +++ b/doc/smart_ptr.adoc @@ -18,40 +18,25 @@ Greg Colvin, Beman Dawes, Peter Dimov, Glen Fernandes :leveloffset: +1 include::smart_ptr/introduction.adoc[] - include::smart_ptr/changelog.adoc[] - include::smart_ptr/scoped_ptr.adoc[] - include::smart_ptr/scoped_array.adoc[] - include::smart_ptr/shared_ptr.adoc[] - include::smart_ptr/weak_ptr.adoc[] - include::smart_ptr/make_shared.adoc[] - include::smart_ptr/enable_shared_from_this.adoc[] - include::smart_ptr/enable_shared_from.adoc[] - include::smart_ptr/make_unique.adoc[] - include::smart_ptr/allocate_unique.adoc[] - include::smart_ptr/intrusive_ptr.adoc[] - include::smart_ptr/intrusive_ref_counter.adoc[] - include::smart_ptr/local_shared_ptr.adoc[] - include::smart_ptr/make_local_shared.adoc[] - include::smart_ptr/pointer_cast.adoc[] - include::smart_ptr/pointer_to_other.adoc[] - include::smart_ptr/atomic_shared_ptr.adoc[] +include::smart_ptr/owner_less.adoc[] +include::smart_ptr/owner_equal_to.adoc[] // appendix include::smart_ptr/techniques.adoc[] @@ -73,7 +58,7 @@ This documentation is * Copyright 1999 Greg Colvin * Copyright 1999 Beman Dawes * Copyright 2002 Darin Adler -* Copyright 2003-2017 Peter Dimov +* Copyright 2003-2020 Peter Dimov * Copyright 2005, 2006 Ion GaztaƱaga * Copyright 2008 Frank Mori Hess * Copyright 2012-2017 Glen Fernandes diff --git a/doc/smart_ptr/changelog.adoc b/doc/smart_ptr/changelog.adoc index b092294..21286ca 100644 --- a/doc/smart_ptr/changelog.adoc +++ b/doc/smart_ptr/changelog.adoc @@ -16,6 +16,7 @@ http://www.boost.org/LICENSE_1_0.txt ## Changes in 1.74.0 * Added `owner_equals` to `shared_ptr`, `weak_ptr`, `local_shared_ptr` +* Added `owner_equal_to` ## Changes in 1.72.0 diff --git a/doc/smart_ptr/owner_equal_to.adoc b/doc/smart_ptr/owner_equal_to.adoc new file mode 100644 index 0000000..d537bab --- /dev/null +++ b/doc/smart_ptr/owner_equal_to.adoc @@ -0,0 +1,45 @@ +//// +Copyright 2020 Peter Dimov +Distributed under the Boost Software License, Version 1.0. +https://www.boost.org/LICENSE_1_0.txt +//// + +[#owner_equal_to] +# owner_equal_to +:toc: +:toc-title: +:idprefix: owner_equal_to_ + +## Description + +`owner_equal_to` is a helper function object that compares two smart +pointer objects using `owner_equals`. + +## Synopsis + +`owner_equal_to` is defined in ``. + +``` +namespace boost { + + template struct owner_equal_to + { + typedef bool result_type; + typedef T first_argument_type; + typedef T second_argument_type; + + template bool operator()( U const & u, V const & v ) const noexcept; + }; +} +``` + +## Members + +``` +template bool operator()( U const & u, V const & v ) const noexcept; +``` +[none] +* {blank} ++ +Returns:: + `u.owner_equals( v )`. diff --git a/doc/smart_ptr/owner_less.adoc b/doc/smart_ptr/owner_less.adoc new file mode 100644 index 0000000..7aead1e --- /dev/null +++ b/doc/smart_ptr/owner_less.adoc @@ -0,0 +1,50 @@ +//// +Copyright 2020 Peter Dimov +Distributed under the Boost Software License, Version 1.0. +https://www.boost.org/LICENSE_1_0.txt +//// + +[#owner_less] +# owner_less +:toc: +:toc-title: +:idprefix: owner_less_ + +## Description + +`owner_less` is a helper function object that compares two smart +pointer objects using `owner_before`. It is only provided for compatibility +with {cpp}11 and corresponds to the standard component of the same name. + +When using Boost smart pointers, the use of `owner_less` is unnecessary, as +the supplied `operator<` overloads (and, correspondingly, `std::less`) return +the same result. + +## Synopsis + +`owner_less` is defined in ``. + +``` +namespace boost { + + template struct owner_less + { + typedef bool result_type; + typedef T first_argument_type; + typedef T second_argument_type; + + template bool operator()( U const & u, V const & v ) const noexcept; + }; +} +``` + +## Members + +``` +template bool operator()( U const & u, V const & v ) const noexcept; +``` +[none] +* {blank} ++ +Returns:: + `u.owner_before( v )`.