<ranges>: Fix regression with ranges::to for ADL-only begin/end by frederick-vs-ja · Pull Request #5173 · microsoft/STL (original) (raw)

In #4539, the ranges::for_each call in the resolution of LWG-4016 was "manually inlined" to reduce inclusion dependency. However, the inlining was not always correct, because builtin-in range-for may just stop and fail when a deleted member begin/end function is encountered, while ranges CPOs continue to consider ADL-found begin/end.

As a result, we should still use ranges::begin/ranges::end.

Fixes #5172.