This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of TS status.

2515. [fund.ts.v2] Certain comparison operators of observer_ptr do not match synopsis

Section: 8.12.6 [fund.ts.v2::memory.observer.ptr.special] Status: TS Submitter: Tim Song Opened: 2015-07-07 Last modified: 2017-07-30

Priority: 0

View all issues with TS status.

Discussion:

Addresses: fund.ts.v2

In N4529 [memory.observer.ptr.special] paragraphs 15, 17 and 19, the >, <= and >= operators of observer_ptr are shown as

template <class W> 
bool operator>(observer_ptr<W> p1, observer_ptr<W> p2);

whereas in [header.memory.synop] they are shown as

template <class W1, class W2> 
bool operator>(observer_ptr<W1> p1, observer_ptr<W2> p2);

Given that the specification of operator< took special care to support hetergeneous types, presumably the second version is intended.

[2015-07, Telecon]

Move to Tentatively Ready.

Proposed resolution:

This wording is relative to N4529.

  1. Edit 8.12.6 [fund.ts.v2::memory.observer.ptr.special] as indicated:

    -15- template <class W1, class W2>
    bool operator>(observer_ptr<W1> p1, observer_ptr<W2> p2);
    

    […]

    -17- template <class W1, class W2>
    bool operator<=(observer_ptr<W1> p1, observer_ptr<W2> p2);
    

    […]

    -19- template <class W1, class W2>
    bool operator>=(observer_ptr<W1> p1, observer_ptr<W2> p2);