Bug in std::vector?
Dmitriy Morozov
gcc@foxcub.org
Fri Mar 14 22:54:00 GMT 2003
Hi,
In .../bits/stl_vector.h, in class vector<_Tp, _Alloc>, there is a
typedef value_type* pointer;
while it really should be something like
typedef allocator_type::pointer pointer;
This is just an example, this problem (of assuming that _Tp* is the
pointer to element type) arises throughout the whole vector hierarchy
(and I'm sure appears for other containers as well), and ignores the
fact that one could provide his own pointer type in the allocator. Am
I missing something here, or is this indeed a bug? If I am missing
something, can you, please, explain to me what? If this is a bug, are
there any plans to fix it, and are there any suggested workarounds,
which I cannot imagine there being many, but, nevertheless, it can't
hurt to ask. Basically, can you comment on the issue?
Thanks,
Dmitriy
--
Dmitriy Morozov
More information about the Libstdc++
mailing list