Boost logo

Boost-Commit :

From: daniel_james_at_[hidden]
Date: 2008-01-06 08:24:48


Author: danieljames
Date: 2008-01-06 08:24:47 EST (Sun, 06 Jan 2008)
New Revision: 42525
URL: http://svn.boost.org/trac/boost/changeset/42525

Log:
Add note about intent to implementation operator== and operator!=.
Text files modified:
   branches/unordered/trunk/libs/unordered/doc/comparison.qbk | 7 +++++--
   branches/unordered/trunk/libs/unordered/doc/rationale.qbk | 11 +++++++++++
   2 files changed, 16 insertions(+), 2 deletions(-)

Modified: branches/unordered/trunk/libs/unordered/doc/comparison.qbk
==============================================================================
--- branches/unordered/trunk/libs/unordered/doc/comparison.qbk (original)
+++ branches/unordered/trunk/libs/unordered/doc/comparison.qbk 2008-01-06 08:24:47 EST (Sun, 06 Jan 2008)
@@ -70,8 +70,11 @@
             required to have any correspondence.)]
     ]
     [
- [Can be compared using the `==`, `!=`, `<`, `<=`, `>`, `>=` operators]
- [No comparison operators are defined]
+ [Can be compared using the `==`, `!=`, `<`, `<=`, `>`, `>=` operators.]
+ [No comparison operators are defined in the standard, although
+ [link unordered.rationale.equality_operator
+ implementations might extend the containers to support `==` and
+ `!=`].]
     ]
     [
         []

Modified: branches/unordered/trunk/libs/unordered/doc/rationale.qbk
==============================================================================
--- branches/unordered/trunk/libs/unordered/doc/rationale.qbk (original)
+++ branches/unordered/trunk/libs/unordered/doc/rationale.qbk 2008-01-06 08:24:47 EST (Sun, 06 Jan 2008)
@@ -198,4 +198,15 @@
 new constructors in `std::pair`. But partial support is possible - especially
 if I don't use the `construct` member of allocators.
 
+[h3 Equality operator]
+
+While `operator==` and `operator!=` are not included in the standard, it's
+possible to implement them for all the containers - this is helped by having
+stable order of elements with equivalent keys. They will need to be specified
+differently to the standard associative containers, probably comparing keys
+using the equality predicate rather than `operator==`. This is inconsistent
+with the other containers but it is probably closer to user's expectations.
+
+If these are added then a `hash_value` free function should also be added.
+
 [endsect]


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk