From 15a7a839f9b31d1cf6f5801732caf00ab4cfa3b7 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Mon, 7 Jan 2002 15:43:30 +0000 Subject: [PATCH] Choose proxy for operator->() only if the reference type is not a reference. Updated workarounds for __MWERKS__ == 0x2406 [SVN r12245] --- include/boost/iterator_adaptors.hpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/include/boost/iterator_adaptors.hpp b/include/boost/iterator_adaptors.hpp index 3387bb6..96bc148 100644 --- a/include/boost/iterator_adaptors.hpp +++ b/include/boost/iterator_adaptors.hpp @@ -12,6 +12,9 @@ // // Revision History: +// 07 Jan 2001 David Abrahams +// Choose proxy for operator->() only if the reference type is not a reference. +// Updated workarounds for __MWERKS__ == 0x2406 // 20 Dec 2001 David Abrahams // Adjusted is_convertible workarounds for __MWERKS__ == 0x2406 // 03 Nov 2001 Jeremy Siek @@ -352,17 +355,14 @@ namespace detail { return &(*i); } - template + template struct operator_arrow_result_generator { typedef operator_arrow_proxy proxy; // Borland chokes unless it's an actual enum (!) - enum { is_input_iter - = (boost::is_convertible::value - & !boost::is_convertible::value) - }; + enum { use_proxy = !boost::is_reference::value }; - typedef typename boost::detail::if_true<(is_input_iter)>::template + typedef typename boost::detail::if_true<(use_proxy)>::template then< proxy, // else @@ -851,7 +851,7 @@ struct iterator_adaptor : # pragma warning( disable : 4284 ) #endif - typename boost::detail::operator_arrow_result_generator::type + typename boost::detail::operator_arrow_result_generator::type operator->() const { return detail::operator_arrow(*this, iterator_category()); } @@ -1335,7 +1335,7 @@ namespace detail { template struct non_bidirectional_category { -# if !defined(__MWERKS__) || __MWERKS__ > 0x2405 +# if !defined(__MWERKS__) || __MWERKS__ > 0x2406 typedef typename reduce_to_base_class< std::forward_iterator_tag, typename iterator_traits::iterator_category