[PATCH] [libc++] Move enable_if to 2nd argument of std::vector(iterator, iterator) ctor

Richard Smith richard at metafoo.co.uk
Sat Sep 21 15:12:46 PDT 2013



================
Comment at: include/vector:521-528
@@ -520,9 +520,10 @@
     vector(size_type __n, const_reference __x, const allocator_type& __a);
     template <class _InputIterator>
-        vector(_InputIterator __first, _InputIterator __last,
+        vector(_InputIterator __first,
                typename enable_if<__is_input_iterator  <_InputIterator>::value &&
                                  !__is_forward_iterator<_InputIterator>::value &&
                                  is_constructible<
                                     value_type,
-                                    typename iterator_traits<_InputIterator>::reference>::value>::type* = 0);
+                                    typename iterator_traits<_InputIterator>::reference>::value,
+                                 _InputIterator>::type __last);
     template <class _InputIterator>
----------------
I don't believe this is a correct change.

    std::vector<int> v( {}, my_weird_iterator );

... cannot deduce the type of `_InputIterator`.


http://llvm-reviews.chandlerc.com/D1723



More information about the cfe-commits mailing list