summaryrefslogtreecommitdiff
path: root/src/mongo/bson/bsonmisc.h
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2016-05-03 13:57:13 -0400
committerDavid Storch <david.storch@10gen.com>2016-05-04 09:41:58 -0400
commit3e3313409d90026ed5f629e8ffb87b04cca5a524 (patch)
tree89552b979750cb9d5c4abf26472bb9211179eb19 /src/mongo/bson/bsonmisc.h
parent8f445bef3ad620018a422e7b08ebff552dd0b825 (diff)
downloadmongo-3e3313409d90026ed5f629e8ffb87b04cca5a524.tar.gz
SERVER-23349 make CollatorInterface methods const
Also changes all uses of CollatorInterface* to pointers-to-const.
Diffstat (limited to 'src/mongo/bson/bsonmisc.h')
-rw-r--r--src/mongo/bson/bsonmisc.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mongo/bson/bsonmisc.h b/src/mongo/bson/bsonmisc.h
index 55d80e7821f..89a24015238 100644
--- a/src/mongo/bson/bsonmisc.h
+++ b/src/mongo/bson/bsonmisc.h
@@ -43,7 +43,7 @@ public:
* string elements. A custom string comparator may be provided, but it must outlive the
* constructed BSONElementCmpWithoutField.
*/
- BSONElementCmpWithoutField(StringData::ComparatorInterface* stringComparator = nullptr)
+ BSONElementCmpWithoutField(const StringData::ComparatorInterface* stringComparator = nullptr)
: _stringComparator(stringComparator) {}
bool operator()(const BSONElement& l, const BSONElement& r) const {
@@ -51,7 +51,7 @@ public:
}
private:
- StringData::ComparatorInterface* _stringComparator;
+ const StringData::ComparatorInterface* _stringComparator;
};
class BSONObjCmp {
@@ -62,7 +62,7 @@ public:
* constructed BSONElementCmpWithoutField.
*/
BSONObjCmp(const BSONObj& order = BSONObj(),
- StringData::ComparatorInterface* stringComparator = nullptr)
+ const StringData::ComparatorInterface* stringComparator = nullptr)
: _order(order), _stringComparator(stringComparator) {}
bool operator()(const BSONObj& l, const BSONObj& r) const {
return l.woCompare(r, _order, true, _stringComparator) < 0;
@@ -73,7 +73,7 @@ public:
private:
BSONObj _order;
- StringData::ComparatorInterface* _stringComparator;
+ const StringData::ComparatorInterface* _stringComparator;
};
typedef std::set<BSONObj, BSONObjCmp> BSONObjSet;