[libcxx-commits] [PATCH] D88727: vector (iterator, iterator) constructor doesn't deduce second arg

kamlesh kumar via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Oct 14 09:10:33 PDT 2020


kamleshbhalui added a comment.

In D88727#2330286 <https://reviews.llvm.org/D88727#2330286>, @mclow.lists wrote:

> Is this a problem unique to `vector`?  Do the other containers have the same constructor? Do those constructors have the same issue?
> Checking ... `list` does not seem to have this problem. `deque` does not either. `forward_list` does not either.
>
> <deque> has the following code:
>
>   template <class _InputIter>
>       deque(_InputIter __f, _InputIter __l,
>             typename enable_if<__is_cpp17_input_iterator<_InputIter>::value>::type* = 0);
>   template <class _InputIter>
>       deque(_InputIter __f, _InputIter __l, const allocator_type& __a,
>             typename enable_if<__is_cpp17_input_iterator<_InputIter>::value>::type* = 0);
>
> I don't think that making `vector` different from the other containers is the right approach.  Then again, I'm not 100% sure why the existing code is failing - so I should look at that.

ook

In D88727#2330286 <https://reviews.llvm.org/D88727#2330286>, @mclow.lists wrote:

> Is this a problem unique to `vector`?  Do the other containers have the same constructor? Do those constructors have the same issue?
> Checking ... `list` does not seem to have this problem. `deque` does not either. `forward_list` does not either.
>
> <deque> has the following code:
>
>   template <class _InputIter>
>       deque(_InputIter __f, _InputIter __l,
>             typename enable_if<__is_cpp17_input_iterator<_InputIter>::value>::type* = 0);
>   template <class _InputIter>
>       deque(_InputIter __f, _InputIter __l, const allocator_type& __a,
>             typename enable_if<__is_cpp17_input_iterator<_InputIter>::value>::type* = 0);
>
> I don't think that making `vector` different from the other containers is the right approach.  Then again, I'm not 100% sure why the existing code is failing - so I should look at tha

Looks like because of this patch vector deviated from other container implementation.
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20130916/089030.html


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88727/new/

https://reviews.llvm.org/D88727



More information about the libcxx-commits mailing list