tcanens added inline comments.

================
Comment at: include/string:2826-2827
@@ -2787,13 +2825,4 @@
 #endif
-    size_type __old_sz = size();
-    difference_type __ip = __pos - begin();
-    for (; __first != __last; ++__first)
-        push_back(*__first);
-    pointer __p = __get_pointer();
-    _VSTD::rotate(__p + __ip, __p + __old_sz, __p + size());
-#if _LIBCPP_DEBUG_LEVEL >= 2
-    return iterator(this, __p + __ip);
-#else
-    return iterator(__p + __ip);
-#endif
+    basic_string __temp(__first, __last, __alloc());
+    return insert(__pos, __temp.begin(), __temp.end());
 }
----------------
This may cause infinite recursion if the allocator uses a fancy pointer (so 
that `__libcpp_string_gets_noexcept_iterator` returns `false`). 

Perhaps `return insert(__pos, __temp.data(), __temp.data()+__temp.size());`?


http://reviews.llvm.org/D15862



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to