[libcxx-commits] [libcxx] Optimize __assign_with_sentinel in std::vector (PR #113852)

Peng Liu via libcxx-commits libcxx-commits at lists.llvm.org
Mon Nov 11 10:37:58 PST 2024


================
@@ -48,6 +48,76 @@ void BM_Assignment(benchmark::State& st, Container) {
   }
 }
 
+// Wrap any Iterator into an input iterator
+template <typename Iterator>
+class InputIterator {
----------------
winner245 wrote:

Exactly. This `InputIterator` wrapper class ensures that `vector::assign(_InputIterator, _InputIterator)` invokes `__assign_with_sentinel`, not `__assign_with_size`. 

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


More information about the libcxx-commits mailing list