Modify

Opened 4 years ago

Last modified 4 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:

Description

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&);
    public:
        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.

Attachments (0)

Change History (2)

comment:1 Changed 4 years ago by Eric Niebler

Owner: changed from Thomas Witt to Dave Abrahams

comment:2 Changed 4 years ago by Dave Abrahams

Owner: changed from Dave Abrahams to jeffrey.hellrung

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain jeffrey.hellrung.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.