cpp-btree: Fix -Wdeprecated-copy warnings on GCC 9

This commit is contained in:
Jonathan G Rennison
2019-11-05 18:07:49 +00:00
parent 0a027a279d
commit e81697c363

View File

@@ -184,6 +184,7 @@ struct btree_key_compare_to_adapter : Compare {
btree_key_compare_to_adapter(const btree_key_compare_to_adapter<Compare> &c) btree_key_compare_to_adapter(const btree_key_compare_to_adapter<Compare> &c)
: Compare(c) { : Compare(c) {
} }
btree_key_compare_to_adapter &operator=(const btree_key_compare_to_adapter &) = default;
}; };
template <> template <>
@@ -196,6 +197,7 @@ struct btree_key_compare_to_adapter<std::less<std::string> >
int operator()(const std::string &a, const std::string &b) const { int operator()(const std::string &a, const std::string &b) const {
return a.compare(b); return a.compare(b);
} }
btree_key_compare_to_adapter &operator=(const btree_key_compare_to_adapter &) = default;
}; };
template <> template <>
@@ -208,6 +210,7 @@ struct btree_key_compare_to_adapter<std::greater<std::string> >
int operator()(const std::string &a, const std::string &b) const { int operator()(const std::string &a, const std::string &b) const {
return b.compare(a); return b.compare(a);
} }
btree_key_compare_to_adapter &operator=(const btree_key_compare_to_adapter &) = default;
}; };
// A helper class that allows a compare-to functor to behave like a plain // A helper class that allows a compare-to functor to behave like a plain
@@ -760,6 +763,8 @@ struct btree_iterator {
position(x.position) { position(x.position) {
} }
btree_iterator &operator=(const btree_iterator &) = default;
// Increment/decrement the iterator. // Increment/decrement the iterator.
void increment() { void increment() {
if (node->leaf() && ++position < node->count()) { if (node->leaf() && ++position < node->count()) {