From 2325b6070a72ed50d40993f0870f2f192872ec0d Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Tue, 6 Jan 2004 17:35:36 +0000 Subject: [PATCH 1/6] Added traits: is_incrementable.hpp: checks whether ++x is well-formed pointee.hpp: value_type of iterators or smart pointers indirect_reference.hpp: reference type of iterators or smart pointers indirect_iterator.hpp indirect_iterator_member_types.cpp Use pointee/indirect_reference to select value/reference type. iterator_concepts.hpp: Fixed interoperable test. Hardly tests enough, but it's a start minimum_category.hpp: Better error messages for vc6 indirect_iterator_test.cpp: Workarounds for compilers without SFINAE static_assert_same.hpp: Informative error reports; added a macro. zip_iterator_test.hpp: Added missing #include Jamfile: made zip_iterator test pass with vc6/stlport [SVN r21514] --- include/boost/indirect_reference.hpp | 40 ++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 include/boost/indirect_reference.hpp diff --git a/include/boost/indirect_reference.hpp b/include/boost/indirect_reference.hpp new file mode 100755 index 0000000..51fedb1 --- /dev/null +++ b/include/boost/indirect_reference.hpp @@ -0,0 +1,40 @@ +// Copyright David Abrahams 2004. Use, modification and distribution is +// subject to the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#ifndef INDIRECT_REFERENCE_DWA200415_HPP +# define INDIRECT_REFERENCE_DWA200415_HPP + +// dereferenceable_traits provides access to the value_type and +// reference of a Dereferenceable type. + +# include +# include +# include +# include + +namespace boost { + +namespace detail +{ + template + struct smart_ptr_reference + { + typedef typename P::element_type& type; + }; +} + +template +struct indirect_reference +{ + typedef typename remove_cv

::type stripped; + + typedef typename mpl::apply_if< + detail::is_incrementable + , iterator_reference + , detail::smart_ptr_reference + >::type type; +}; + +} // namespace boost + +#endif // INDIRECT_REFERENCE_DWA200415_HPP From 84cd6e1be413039ad81c8f40b736be9423cb16a7 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Sun, 11 Jan 2004 00:03:09 +0000 Subject: [PATCH 2/6] Updated pointee and indirect_reference so that pointee represents the immutability of the pointed-to type via const qualification. The pointee of a proxy-based iterator will be const qualified unless a mutable reference to the value_type can be bound to the returned proxy. Added a test for pointee Fixed iterator_facade so operator[] result type computation didn't cause a problem with abstract types. Updated iterator_facade operator[] docs for accuracy. Allowed Borland to simply fail the indirect_iterator_member_types test because of its lame const-dropping, instead of trying to work around it. [SVN r21579] --- include/boost/indirect_reference.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/boost/indirect_reference.hpp b/include/boost/indirect_reference.hpp index 51fedb1..a10453e 100755 --- a/include/boost/indirect_reference.hpp +++ b/include/boost/indirect_reference.hpp @@ -11,6 +11,7 @@ # include # include # include +# include namespace boost { @@ -19,7 +20,7 @@ namespace detail template struct smart_ptr_reference { - typedef typename P::element_type& type; + typedef typename boost::pointee

::type& type; }; } From e6babb8bf94eab116590d095a2c6141c222c206f Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Tue, 13 Jan 2004 19:18:42 +0000 Subject: [PATCH 3/6] Kill off outer cv-stripping of Dereferenceable [SVN r21696] --- include/boost/indirect_reference.hpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/include/boost/indirect_reference.hpp b/include/boost/indirect_reference.hpp index a10453e..270cbbd 100755 --- a/include/boost/indirect_reference.hpp +++ b/include/boost/indirect_reference.hpp @@ -26,14 +26,12 @@ namespace detail template struct indirect_reference + : mpl::apply_if< + detail::is_incrementable

+ , iterator_reference

+ , detail::smart_ptr_reference

+ > { - typedef typename remove_cv

::type stripped; - - typedef typename mpl::apply_if< - detail::is_incrementable - , iterator_reference - , detail::smart_ptr_reference - >::type type; }; } // namespace boost From 290cea828996320dfc94bf4ff1badfae7e6a5c1c Mon Sep 17 00:00:00 2001 From: Aleksey Gurtovoy Date: Thu, 2 Sep 2004 15:41:37 +0000 Subject: [PATCH 4/6] merge new MPL version from 'mplbook' branch [SVN r24874] --- include/boost/indirect_reference.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/indirect_reference.hpp b/include/boost/indirect_reference.hpp index 270cbbd..2e993d9 100755 --- a/include/boost/indirect_reference.hpp +++ b/include/boost/indirect_reference.hpp @@ -10,7 +10,7 @@ # include # include # include -# include +# include # include namespace boost { @@ -26,7 +26,7 @@ namespace detail template struct indirect_reference - : mpl::apply_if< + : mpl::eval_if< detail::is_incrementable

, iterator_reference

, detail::smart_ptr_reference

From 40fd24e5b57b0d2ee921905c3119c5821388fb30 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 20 Mar 2005 14:53:58 +0000 Subject: [PATCH 5/6] Link to documentation added. [SVN r27745] --- include/boost/indirect_reference.hpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/include/boost/indirect_reference.hpp b/include/boost/indirect_reference.hpp index 2e993d9..5fbb342 100755 --- a/include/boost/indirect_reference.hpp +++ b/include/boost/indirect_reference.hpp @@ -1,11 +1,15 @@ -// Copyright David Abrahams 2004. Use, modification and distribution is -// subject to the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef INDIRECT_REFERENCE_DWA200415_HPP # define INDIRECT_REFERENCE_DWA200415_HPP -// dereferenceable_traits provides access to the value_type and -// reference of a Dereferenceable type. +// +// Copyright David Abrahams 2004. Use, modification and distribution is +// subject to the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +// typename indirect_reference

::type provides the type of *p. +// +// http://www.boost.org/libs/iterator/doc/pointee.html +// # include # include From 5d7289ad3e8377f5bb2a526bee6c5661a4d33141 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Wed, 4 Jun 2014 13:02:28 +0400 Subject: [PATCH 6/6] Removed executable attribute. --- include/boost/indirect_reference.hpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 include/boost/indirect_reference.hpp diff --git a/include/boost/indirect_reference.hpp b/include/boost/indirect_reference.hpp old mode 100755 new mode 100644