This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by pcc on Sep 18 2013, 9:59 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

If a pointer is passed as the third argument of the (iterator,
iterator, allocator) constructor with the intention of it being
implicitly converted to the allocator type, it is possible for overload
resolution to favour the (iterator, iterator, enable_if) constructor.
Eliminate this possibility by moving the enable_if to one of the
existing arguments and removing the third argument.

Diff Detail

Event Timeline

rsmith added inline comments.Sep 21 2013, 3:12 PM
include/vector
521–528

I don't believe this is a correct change.

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

... cannot deduce the type of _InputIterator.