mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
fix compilation with VS2019, preview of 16.7 version
Compiler tells something about argument-dependent lookup. I do not understand how that ADL works. But I know that such operators should be free functions, instead of methods: http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Ro-symmetric Such syntax defines 'friend' free functions.
This commit is contained in:
parent
a8c200c73c
commit
7a695d8a82
1 changed files with 8 additions and 2 deletions
|
@ -99,8 +99,14 @@ public:
|
|||
reference operator*() { return *static_cast<pointer>(node_); }
|
||||
pointer operator->() { return static_cast<pointer>(node_); }
|
||||
|
||||
bool operator==(const Iterator &rhs) { return node_ == rhs.node_; }
|
||||
bool operator!=(const Iterator &rhs) { return !(*this == rhs); }
|
||||
friend bool operator==(const Iterator &lhs, const Iterator &rhs)
|
||||
{
|
||||
return lhs.node_ == rhs.node_;
|
||||
}
|
||||
friend bool operator!=(const Iterator &lhs, const Iterator &rhs)
|
||||
{
|
||||
return !(lhs == rhs);
|
||||
}
|
||||
|
||||
private:
|
||||
ListNode *node_;
|
||||
|
|
Loading…
Reference in a new issue