using Base::crbegin;
using Base::crend;
+ bool operator==(StringKeyedMap const& other) const {
+ Base const& lhs = *this;
+ Base const& rhs = static_cast<Base const&>(other);
+ return lhs == rhs;
+ }
+
// no need for copy/move overload as StringPiece is small struct
mapped_type& operator[](StringPiece key) {
auto it = find(key);
using Base::at;
using Base::find;
+ using Base::count;
using Base::lower_bound;
using Base::upper_bound;
Base::clear();
}
+ void swap(StringKeyedMap& other) & {
+ return Base::swap(other);
+ }
+
~StringKeyedMap() {
// Here we assume that map doesn't use keys in destructor
for (auto& it : *this) {
using Base::cbegin;
using Base::cend;
using Base::find;
+ using Base::count;
using Base::lower_bound;
using Base::upper_bound;
+ bool operator==(StringKeyedSetBase const& other) const {
+ Base const& lhs = *this;
+ Base const& rhs = static_cast<Base const&>(other);
+ return lhs == rhs;
+ }
+
template <class... Args>
std::pair<iterator, bool> emplace(Args&&... args) {
auto key = StringPiece(std::forward<Args>(args)...);
using Base::get_allocator;
+ void swap(StringKeyedSetBase& other) & {
+ return Base::swap(other);
+ }
+
~StringKeyedSetBase() {
// Here we assume that set doesn't use keys in destructor
for (auto it : *this) {
using Base::cbegin;
using Base::cend;
- bool operator==(const StringKeyedUnorderedMap& rhs) {
- const Base& lhs = *this;
+ bool operator==(StringKeyedUnorderedMap const& other) const {
+ Base const& lhs = *this;
+ Base const& rhs = static_cast<Base const&>(other);
return lhs == rhs;
}
+ void swap(StringKeyedUnorderedMap& other) & {
+ return Base::swap(other);
+ }
+
// No need for copy/move overload as StringPiece is small struct.
mapped_type& operator[](StringPiece key) {
auto it = find(key);
using Base::cbegin;
using Base::cend;
using Base::find;
+ using Base::count;
- bool operator==(const BasicStringKeyedUnorderedSet& rhs) const {
- const Base& lhs = *this;
+ bool operator==(const BasicStringKeyedUnorderedSet& other) const {
+ Base const& lhs = *this;
+ Base const& rhs = static_cast<Base const&>(other);
return lhs == rhs;
}
using Base::bucket_size;
using Base::bucket;
+ void swap(BasicStringKeyedUnorderedSet& other) & {
+ return Base::swap(other);
+ }
+
~BasicStringKeyedUnorderedSet() {
// Here we assume that unordered_set doesn't use keys in destructor
for (auto& it : *this) {