mirror of https://github.com/oxen-io/lokinet
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36792d4337
Lots and lots of places in the code had broken < operators because they are returning something like: foo < other.foo or bar < other.bar; but this breaks both the strict weak ordering requirements that are required for the "Compare" requirement for things like std::map/set/priority_queue. For example: a = {.foo=1, .bar=3} b = {.foo=3, .bar=1} does not have an ordering over a and b (both `a < b` and `b < a` are satisfied at the same time). This needs to be instead something like: foo < other.foo or (foo == other.foo and bar < other.bar) but that's a bit clunkier, and it is easier to use std::tie for tuple's built-in < comparison which does the right thing: std::tie(foo, bar) < std::tie(other.foo, other.bar) (Initially I noticed this in SockAddr/sockaddr_in6, but upon further investigation this extends to the major of multi-field `operator<`'s.) This fixes it by using std::tie (or something similar) everywhere we are doing multi-field inequalities. |
2 years ago | |
---|---|---|
.. | ||
android | 3 years ago | |
apple | 2 years ago | |
config | 2 years ago | |
consensus | 2 years ago | |
constants | 2 years ago | |
crypto | 2 years ago | |
dht | 2 years ago | |
dns | 2 years ago | |
ev | 2 years ago | |
exit | 2 years ago | |
handlers | 2 years ago | |
iwp | 2 years ago | |
link | 2 years ago | |
linux | 2 years ago | |
messages | 2 years ago | |
net | 2 years ago | |
path | 2 years ago | |
peerstats | 2 years ago | |
quic | 2 years ago | |
router | 2 years ago | |
routing | 2 years ago | |
rpc | 2 years ago | |
service | 2 years ago | |
simulation | 3 years ago | |
tooling | 2 years ago | |
util | 2 years ago | |
vpn | 2 years ago | |
win32 | 2 years ago | |
CMakeLists.txt | 2 years ago | |
app.xml | 6 years ago | |
bootstrap-fallbacks.cpp.in | 2 years ago | |
bootstrap.cpp | 2 years ago | |
bootstrap.hpp | 2 years ago | |
context.cpp | 2 years ago | |
endpoint_base.cpp | 3 years ago | |
endpoint_base.hpp | 2 years ago | |
lokinet_shared.cpp | 2 years ago | |
nodedb.cpp | 2 years ago | |
nodedb.hpp | 3 years ago | |
pow.cpp | 2 years ago | |
pow.hpp | 2 years ago | |
profiling.cpp | 2 years ago | |
profiling.hpp | 2 years ago | |
router_contact.cpp | 2 years ago | |
router_contact.hpp | 2 years ago | |
router_id.cpp | 2 years ago | |
router_id.hpp | 2 years ago | |
router_version.cpp | 3 years ago | |
router_version.hpp | 2 years ago |