Move the < operator definition before the set one, so that old versions
of libstdc++ do not mistakenly refuse to compile:
```
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/map:60:
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/stl_tree.h:452:7: error: static_assert failed due to requirement 'std::__is_invocable<std::less<void> &, const SuffixMatchTree<bool> &, const SuffixMatchTree<bool> &>{}' "comparison object must be invocable with two arguments of key type"
static_assert(__is_invocable<_Compare&, const _Key&, const _Key&>{},
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/stl_set.h:133:17: note: in instantiation of template class 'std::_Rb_tree<SuffixMatchTree<bool>, SuffixMatchTree<bool>, std::_Identity<SuffixMatchTree<bool> >, std::less<void>, std::allocator<SuffixMatchTree<bool> > >' requested here
_Rep_type _M_t; // Red-black tree representing set.
^
../../pdns/dnsname.hh:306:50: note: in instantiation of template class 'std::set<SuffixMatchTree<bool>, std::less<void>, std::allocator<SuffixMatchTree<bool> > >' requested here
mutable std::set<SuffixMatchTree, std::less<>> children;
^
../../pdns/dnsname.hh:497:27: note: in instantiation of template class 'SuffixMatchTree<bool>' requested here
SuffixMatchTree<bool> d_tree;
^
```
Sseen with clang8 on Buster, but see also
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85965
}
return *this;
}
+ bool operator<(const SuffixMatchTree& rhs) const
+ {
+ return strcasecmp(d_name.c_str(), rhs.d_name.c_str()) < 0;
+ }
std::string d_name;
mutable std::set<SuffixMatchTree, std::less<>> children;
mutable bool endNode;
mutable T d_value;
- bool operator<(const SuffixMatchTree& rhs) const
- {
- return strcasecmp(d_name.c_str(), rhs.d_name.c_str()) < 0;
- }
/* this structure is used to do a lookup without allocating and
copying a string, using C++14's heterogeneous lookups in ordered