C++26 introduced std::type_order from P2830 to answer this very question.
GCC has had support for it for quite a while; now Clang does too. Earlier today I merged the required changes to libc++. My implementation of the underlying builtin used to implement this was merged into Clang about two weeks ago.
So, why would you compare types in the first place and what does “it depends” mean?
What actually happens when you try to look things up in this map? Let’s say that you want to test it with handlers.find("/api/v2/accounts/positions/summary"). This code will compile and run quite happily, but under the hood this allocates the literal into an entirely new std::string object, hashes it, finds the value, and then throws the temporary string away.
In C++ tuples are implemented as library feature rather than as language feature. As a consequence of that, we are syntactically limited by what the language offers.
This means rather than being able to subscript tuples directly, we need to use std::get<N>(tup) instead.
So… if we step a bit outside of the boundaries of the standard, can we subscript instead?
You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.