Various cleanups: Declare _Meow_vbool
to avoid ADL
#4151
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I noticed this a while ago, but it's increasingly important due to modules. (This PR avoids the likely compiler bug VSO-1914077 "Modules:
extern "C++"
interferes with ADL".)The
vector<bool>
algorithm optimizations (#879 #1131 #3353) detectvector<bool>
iterators via an internal type trait, then dispatch to dedicated functions. We were defining those functions in<vector>
, but were never declaring them before calling them in<xutility>
(which is "higher up" in the dependency graph), so our calls were actually using ADL. That was squirrelly 🐿️ since we never rely on ADL like this for internal functions.This PR adds declarations (dropping
const
on value parameters as usual), then qualifies the calls for good measure (also aligning with our developing practice of qualifying internal calls, which personally hasn't filled me with delight elsewhere but is definitely reassuring here).