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

### 1316. `scoped_allocator_adaptor operator==` has no definition

Section: 20.13 [allocator.adaptor] Status: C++11 Submitter: Pablo Halpern Opened: 2009-02-11 Last modified: 2016-01-28

Priority: Not Prioritized

View all other issues in [allocator.adaptor].

View all issues with C++11 status.

Discussion:

The WP (N3000) contains these declarations:

>     template <class OuterA1, class OuterA2, class... InnerAllocs>
>       bool operator==(const scoped_allocator_adaptor<OuterA1, InnerAllocs...>& a,
>                       const scoped_allocator_adaptor<OuterA2, InnerAllocs...>& b);
>     template <class OuterA1, class OuterA2, class... InnerAllocs>
>       bool operator!=(const scoped_allocator_adaptor<OuterA1, InnerAllocs...>& a,
>                       const scoped_allocator_adaptor<OuterA2, InnerAllocs...>& b);

But does not define what the behavior of these operators are.

[ Post-Rapperswil: ]

> Moved to Tentatively Ready after 5 positive votes on c++std-lib.

[ Adopted at 2010-11 Batavia ]

Proposed resolution:

Add a new section after 20.13.4 [allocator.adaptor.members]:

> Scoped allocator operators [scoped.adaptor.operators]

>     template <class OuterA1, class OuterA2, class... InnerAllocs>
>       bool operator==(const scoped_allocator_adaptor<OuterA1, InnerAllocs...>& a,
>                       const scoped_allocator_adaptor<OuterA2, InnerAllocs...>& b);

> > Returns: `a.outer_allocator() == b.outer_allocator()` if `sizeof...(InnerAllocs)` is zero; otherwise, `a.outer_allocator() == b.outer_allocator() && a.inner_allocator() == b.inner_allocator()`.

>     template <class OuterA1, class OuterA2, class... InnerAllocs>
>       bool operator!=(const scoped_allocator_adaptor<OuterA1, InnerAllocs...>& a,
>                       const scoped_allocator_adaptor<OuterA2, InnerAllocs...>& b);

> > Returns: `!(a == b)`.