Opened 5 years ago

Last modified 5 years ago

#9562 new Bugs

boost::detail::operator_brackets_proxy::result_type::operator= return type is wrong

Reported by: Eric Niebler Owned by: jeffrey.hellrung
Milestone: To Be Determined Component: iterator
Version: Boost 1.54.0 Severity: Problem
Keywords: Cc:


From boost/iterator/detail/operator_brackets_dispatch.hpp:

template <class Iterator, class Reference>
struct operator_brackets_proxy
    class result_type
        Iterator const m_i;
        explicit result_type(Iterator const & i) : m_i(i) { }
        friend struct operator_brackets_proxy;
        void operator=(result_type&);
        operator Reference() const { return *m_i; }
        operator_brackets_proxy const & operator=(
          typename Iterator::value_type const & x) const
        { *m_i = x; return *this; }
    static result_type apply(Iterator const & i)
    { return result_type(i); }

The return type of result_type::operator= should be result_type const &, not operator_brackets_proxy const &. This looks like a typo.

Change History (2)

comment:1 Changed 5 years ago by Eric Niebler

Owner: changed from Thomas Witt to Dave Abrahams

comment:2 Changed 5 years ago by Dave Abrahams

Owner: changed from Dave Abrahams to jeffrey.hellrung
Note: See TracTickets for help on using tickets.