C++ Logo

std-discussion

Advanced search

Some questions about comparison objects in [associative.reqmts]

From: FrankHB <frankhb1989_at_[hidden]>
Date: Mon, 19 Aug 2019 01:20:00 +0800
1. [associative.reqmts]/2 specifies that "the object of type Compare"
as "the comparison object" of "a container", without any notice about the
relationship between the object and such a container. Since "a container" is
a type (rather than "a container object") in this context, it implies that
there can be arbitrary amount of objects of type Compare counted as the
comparison objects. However, this is inconsistent with the "an empty
container" wording below in the table, which also emphasizes "a copy" of the
comparison object being used. So, which should be the right meaning of
"comparison object"?

2. [associative.reqmts]/13 specifies that the comparison object being
used is "copied" rather than "copy-initialized". Is there any reason to rule
the move construction out here?

3. [associative.reqmts]/13 does not specifie the ownership of the
comparison object explicitly. Does this allow that stateless comparison
objects are not required to be stored in the container objects at all?

 

These questions are particularly interested in reviewing implementations
like this
<https://github.com/gcc-mirror/gcc/blob/master/libstdc++-v3/include/bits/stl
_tree.h#L160> .

 


Received on 2019-08-18 12:22:06