Fix the implementation of operator_arrow_result so that it checks the

reference type instead of the category.


[SVN r20046]
This commit is contained in:
Dave Abrahams
2003-09-14 01:53:59 +00:00
parent 2c89e2b15a
commit abf8390020

View File

@ -166,17 +166,14 @@ namespace boost
// A metafunction that gets the result type for operator->. Also // A metafunction that gets the result type for operator->. Also
// has a static function make() which builds the result from a // has a static function make() which builds the result from a
// Reference // Reference
template <class Value, class Category, class Reference, class Pointer> template <class Value, class Reference, class Pointer>
struct operator_arrow_result struct operator_arrow_result
{ {
// CWPro8.3 won't accept "operator_arrow_result::type", and we // CWPro8.3 won't accept "operator_arrow_result::type", and we
// need that type below, so metafunction forwarding would be a // need that type below, so metafunction forwarding would be a
// losing proposition here. // losing proposition here.
typedef typename mpl::if_< typedef typename mpl::if_<
is_tag< is_reference<Reference>
readable_lvalue_iterator_tag
, typename access_category_tag<Category,Reference>::type
>
, Pointer , Pointer
, operator_arrow_proxy<Value> , operator_arrow_proxy<Value>
>::type type; >::type type;
@ -190,16 +187,15 @@ namespace boost
# if BOOST_WORKAROUND(BOOST_MSVC, <= 1200) # if BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
// Deal with ETI // Deal with ETI
template<> template<>
struct operator_arrow_result<int, int, int, int> struct operator_arrow_result<int, int, int>
{ {
typedef int type; typedef int type;
}; };
# endif # endif
// //
// Facade is actually an iterator. We require Facade here // Iterator is actually an iterator_facade, so we do not have to
// so that we do not have to go through iterator_traits // go through iterator_traits to access the traits.
// to access the traits
// //
template <class Iterator> template <class Iterator>
class operator_brackets_proxy class operator_brackets_proxy
@ -422,7 +418,6 @@ namespace boost
typename detail::operator_arrow_result< typename detail::operator_arrow_result<
value_type value_type
, iterator_category
, reference , reference
, pointer , pointer
>::type >::type
@ -430,7 +425,6 @@ namespace boost
{ {
return detail::operator_arrow_result< return detail::operator_arrow_result<
value_type value_type
, iterator_category
, reference , reference
, pointer , pointer
>::make(*this->derived()); >::make(*this->derived());