This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Bug in std::vector?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]