<br><br><div class="gmail_quote">On Tue, Mar 26, 2013 at 8:04 PM, Howard Hinnant <span dir="ltr"><<a href="mailto:hhinnant@apple.com" target="_blank">hhinnant@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: hhinnant<br>
Date: Tue Mar 26 14:04:56 2013<br>
New Revision: 178064<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=178064&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=178064&view=rev</a><br>
Log:<br>
Another vector debug mode test, and a static test on Allocator::value_type.  This partially addresses <a href="http://llvm.org/bugs/show_bug.cgi?id=15576" target="_blank">http://llvm.org/bugs/show_bug.cgi?id=15576</a>.<br>

<br>
Modified:<br>
    libcxx/trunk/include/vector<br>
    libcxx/trunk/test/containers/sequences/vector/vector.cons/move.pass.cpp<br>
<br>
Modified: libcxx/trunk/include/vector<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/vector?rev=178064&r1=178063&r2=178064&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/vector?rev=178064&r1=178063&r2=178064&view=diff</a><br>

==============================================================================<br>
--- libcxx/trunk/include/vector (original)<br>
+++ libcxx/trunk/include/vector Tue Mar 26 14:04:56 2013<br>
@@ -502,6 +502,9 @@ public:<br>
     typedef _VSTD::reverse_iterator<iterator>         reverse_iterator;<br>
     typedef _VSTD::reverse_iterator<const_iterator>   const_reverse_iterator;<br>
<br>
+    static_assert((is_same<typename allocator_type::value_type, value_type>::value),<br>
+                  "Allocator::value_type must be same type as value_type");<br>
+<br>
     _LIBCPP_INLINE_VISIBILITY<br>
     vector()<br>
         _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)<br>
<br>
Modified: libcxx/trunk/test/containers/sequences/vector/vector.cons/move.pass.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/sequences/vector/vector.cons/move.pass.cpp?rev=178064&r1=178063&r2=178064&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/sequences/vector/vector.cons/move.pass.cpp?rev=178064&r1=178063&r2=178064&view=diff</a><br>

==============================================================================<br>
--- libcxx/trunk/test/containers/sequences/vector/vector.cons/move.pass.cpp (original)<br>
+++ libcxx/trunk/test/containers/sequences/vector/vector.cons/move.pass.cpp Tue Mar 26 14:04:56 2013<br>
@@ -45,5 +45,13 @@ int main()<br>
         assert(l.empty());<br>
         assert(l2.get_allocator() == lo.get_allocator());<br>
     }<br>
+    {<br>
+        int a1[] = {1, 3, 7, 9, 10};<br>
+        std::vector<int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));<br>
+        std::vector<int>::const_iterator i = c1.begin();<br>
+        std::vector<int> c2 = std::move(c1);<br>
+        std::vector<int>::iterator j = c2.erase(i);<br>
+        assert(*j == 3);<br>
+    }<br>
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES<br>
 }<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br>I am really glad to see work on the "debuggability" of the libc++ library. It had been a while since there had been any updates on it!<br><br>Are there specific plans for other parts of the STL ? (other containers or for example having a dynamic check that algorithms expecting a sorted range are actually given such a range ?)<br>
<br>-- Matthieu<br>