]>
git.ipfire.org Git - thirdparty/squid.git/commit
Optimize RefCount comparison with raw pointers (#1200)
GCC v12 and Clang v12 tests show that compilers cannot avoid creating
temporaries when comparing RefCount objects with arbitrary pointers.
Also fixes (not yet supported) C++20 build. C++20 automatically reverses
equality comparisons, triggering an ambiguity:
src/esi/Esi.cc:1920:26: error: ambiguous overload for 'operator=='
(operand types are 'ESISegment::Pointer' {aka
'RefCount<ESISegment>'} and std::nullptr_t)
assert (output->next == nullptr);
src/esi/Esi.cc:77:6: note: candidate: 'bool operator==(const
ESIElement*, const Pointer&)' (reversed)
src/base/RefCount.h:82:10: note: candidate: 'bool
RefCount<C>::operator==(const RefCount<C>&) const [with C =
ESISegment]'