File tree Expand file tree Collapse file tree 1 file changed +6
-14
lines changed Expand file tree Collapse file tree 1 file changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -132,24 +132,16 @@ namespace bencode {
132132 auto key_comp () const { return proxy_->key_comp (); }
133133 auto value_comp () const { return proxy_->value_comp (); }
134134
135+ friend bool operator ==(const map_proxy &lhs, const map_proxy &rhs) {
136+ return *lhs == *rhs;
137+ }
138+ friend auto operator <=>(const map_proxy &lhs, const map_proxy &rhs) {
139+ return *lhs <=> *rhs;
140+ }
135141 private:
136142 std::unique_ptr<map_type> proxy_;
137143 };
138144
139- #define BENCODE_MAP_PROXY_RELOP (op ) \
140- template <typename Key, typename Value> \
141- bool operator op (const map_proxy<Key, Value> &lhs, \
142- const map_proxy<Key, Value> &rhs) { \
143- return *lhs == *rhs; \
144- }
145-
146- BENCODE_MAP_PROXY_RELOP (==)
147- BENCODE_MAP_PROXY_RELOP (!=)
148- BENCODE_MAP_PROXY_RELOP (>=)
149- BENCODE_MAP_PROXY_RELOP (<=)
150- BENCODE_MAP_PROXY_RELOP (>)
151- BENCODE_MAP_PROXY_RELOP (<)
152-
153145#define BENCODE_DATA_GETTER (func, impl, arg_type, container_type ) \
154146 basic_data & func (const arg_type &key) & { \
155147 return impl<container_type>(*this , key); \
You can’t perform that action at this time.
0 commit comments