https://bugs.llvm.org/show_bug.cgi?id=34906
Bug ID: 34906
Summary: vector::insert(pos, iter, iter) incorrectly requires
value-assignment for forward_iterators.
Product: libc++
Version: unspecified
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: All Bugs
Assignee: unassignedclangb...@nondot.org
Reporter: e...@efcs.ca
CC: llvm-bugs@lists.llvm.org, mclow.li...@gmail.com
According to the spec, this overload of `insert` doesn't require that the
elements in the vector be assignable from the iterator value_type. However
libc++ currently requires this.
Example:
// clang++ -stdlib=libc++ -std=c++11 test.cpp
#include <vector>
template <class T>
struct EmplaceConstructibleAndMoveable {
explicit EmplaceConstructibleAndMoveable(T) {}
EmplaceConstructibleAndMoveable(EmplaceConstructibleAndMoveable&&) =
default;
EmplaceConstructibleAndMoveable&
operator=(EmplaceConstructibleAndMoveable&&) = default;
};
int main() {
using T = EmplaceConstructibleAndMoveable<int>;
std::vector<T> v;
int Inits[] = {1, 2, 3};
v.insert(v.end(), std::begin(Inits), std::end(Inits));
}
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs