Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@frederick-vs-ja
Copy link
Contributor

@frederick-vs-ja frederick-vs-ja commented Feb 17, 2024

Towards #140. Fixes #1596. IIUC remaining unqualified _Adl_verify_range calls after this PR are not supposed to involve ADL-incompatible iterators.

Affected components:

  • ranges::advance (non-sized branch)
  • ranges::distance (non-sized branch)
  • span constructors
  • condition_variable::wait_for

Notes:

  • _STD-qualification is also made in std::advance and std::distance for consistency, but IIUC these code paths don't handle ADL-incompatible iterators.
  • _To_absolute_time remains unqualified, because valid _Rep in chrono::duration<_Rep, _Period> requires _Rep to be "arithmetic-like" type (although the requirements are unclear), and thus must not be ADL-incompatible.
  • Currently, span<holder<incomplete>*> can't be supported in C++23 mode because const_iterator<_Span_iterator<holder<incomplete>*>> is ill-formed due to ADL in constraints checking. I guess this might need to be fixed in vNext.

These code paths don't handle ADL-incompatible iterators, and `_STD`
is added for consistency.
Currently, the C++23 additions renders `span` not supporting
ADL-incompatible element types. Perhaps we should fix this in vNext.
`_To_absolute_time` remains unqualified because I don't believe
`_Rep` is allowed to be an ADL-incompatible type.
@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner February 17, 2024 09:46
@frederick-vs-ja frederick-vs-ja changed the title ADL-proof implementation of possibly problematic range verifying and function passing components ADL-proof implementation of possibly problematic range verifying and functor passing components Feb 17, 2024
@frederick-vs-ja frederick-vs-ja changed the title ADL-proof implementation of possibly problematic range verifying and functor passing components ADL-proof implementation of range verifying and functor passing components that involve arbitrary types Feb 17, 2024
@StephanTLavavej StephanTLavavej added the bug Something isn't working label Feb 17, 2024
@StephanTLavavej StephanTLavavej self-assigned this Feb 17, 2024
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit c8ac6d9 into microsoft:main Feb 27, 2024
@StephanTLavavej
Copy link
Member

Thanks for verifying _Adl_verify_range! 🔁 🎉 😸

@frederick-vs-ja frederick-vs-ja deleted the adl-proof-algo-like branch February 27, 2024 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

<algorithm>: unqualified calls to _Adl_verify_range incorrectly cause instantiation

2 participants