[llvm] [llvm][ADT] Use ADL to find begin()/end() in interleave* (PR #87669)

Cassie Jones via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 4 14:03:56 PDT 2024


================
@@ -2151,15 +2151,15 @@ template <typename Container, typename UnaryFunctor, typename NullaryFunctor,
               !std::is_constructible<StringRef, NullaryFunctor>::value>>
 inline void interleave(const Container &c, UnaryFunctor each_fn,
                        NullaryFunctor between_fn) {
-  interleave(c.begin(), c.end(), each_fn, between_fn);
+  interleave(adl_begin(c), adl_end(c), each_fn, between_fn);
----------------
porglezomp wrote:

So in the case of upgrading from `.begin()` it's not to keep compatibility with anything, but to make this behave more nicely for future types. Thanks for confirming!

https://github.com/llvm/llvm-project/pull/87669


More information about the llvm-commits mailing list