http://llvm.org/bugs/show_bug.cgi?id=15576
Bug ID: 15576
Summary: vector<T1, allocator<T2>> fails to compile
Product: libc++
Version: 3.2
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: All Bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
this code fails to compile with a rather obscure error message in v[0]:
```
#include <vector>
using namespace std;
vector<size_t, allocator<int>> v;
int main()
{
v.push_back(0);
v[0];
return 0;
}
```
gcc/libstdc++ accept this code, though. iac, i'd suggest one of two
workarounds:
* rebind the allocator to the type of the vector
* add a static assertion that (Alloc::value_type == vector::value_type). this
should simplify finding this kind of issues where they appear
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs