[libcxx-commits] [libcxx] [libc++] Forward more algorithms to the classic algorithms (PR #114674)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon Nov 4 08:28:47 PST 2024


================
@@ -216,6 +216,9 @@ struct _IterOps<_ClassicAlgPolicy> {
   }
 };
 
+template <class _AlgPolicy, class _Iter>
+using __policy_iter_diff_t = typename _IterOps<_AlgPolicy>::template __difference_type<_Iter>;
----------------
ldionne wrote:

I would find it clearer to instead do this at the beginning of algorithms that need it:

```c++
using _Difference = typename _IterOps<_AlgPolicy>::template __difference_type<_Iter>;
```

And then to use `_Difference` throughout. `__policy_iter_diff_t` introduces yet another short-name that I'd rather not have to remember. Not a blocking comment since this is somewhat subjective.

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


More information about the libcxx-commits mailing list