[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: stl-vector of pointers to elements of another vector
From: |
Ulrich Eckhardt |
Subject: |
Re: stl-vector of pointers to elements of another vector |
Date: |
Sat, 22 Jan 2005 22:27:42 +0100 |
User-agent: |
KNode/0.8.1 |
Lutz Gebhardt wrote:
> std::vector<int> testlist;
[...]
> std::vector<int*> testselect;
> std::vector<int>::iterator test_itr = testlist.begin();
> testselect.push_back(test_itr); // **** Problem statement *****
> Might this be caused by a missing implementation in the gcc-supplied
> STL or am I doing something very bad here which works just by chance
> on the other platforms?
You are doing something bad, you assume vector-iterators are pointers.
Nothing specific to GCC.
Uli
--
http://gcc.gnu.org/faq.html
http://parashift.com/c++-faq-lite/