While working on #33922 I initially forgot to add CTransactionRefComp to the std::unordered_map<CTransactionRef defined there. This PR turns that into a compiler error.
This change triggers a false positive IWYU error, and an inconsistent one at that: our CI wants <variant>, while a manual build on Ubuntu (version 0.26 with clang version 22.1.1) wants <string_view>.
Various workarounds were discussed in:
The approach chosen here is:
- narrowly scoped to this file
- does add unneeded includes
- does not ignore the false positive
<variant>/<string_view>requirement (as that could cause future bugs) - works independent of the exact IWYU build
- is skipped for libc++, because that doesn't have the false positive and the workaround triggers an ambiguous specialization.
The main downside is that it's slightly verbose, though mostly from the comment.