This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: What's wrong with vector<>::at(int) ?
- To: Andrew Guts <andr at fe-club dot net>
- Subject: Re: What's wrong with vector<>::at(int) ?
- From: bley at wh2-19 dot st dot uni-magdeburg dot de (Claudio Bley)
- Date: Thu, 1 Nov 2001 09:36:33 +0100
- Cc: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- References: <3BDD400A.EADDDFDC@fe-club.net><3BE104DA.87A93713@fe-club.net>
>>>>> "Andrew" == Andrew Guts <andr@fe-club.net> writes:
Andrew> Hello All. So nobody wants to help me?
Andrew> Thanks anyway
There simply just is no implementation of vector<>::at(size_t) in
libstdc++-2.x.
But you can get around this easily. Either install a new version or
just use the [] operator (check the index range manually beforehand if
you need to).
Claudio
Andrew> Andrew Guts wrote:
>> Such code was compiled well with VC++. What's wrong for gcc ?
>>
>> class Item {};
>>
>> class My { protected: vector <Item> item; ... public: ...
>> const Item& getitem(int i) const { return item.at(i); }
>>
>> }
>>
>> d.cpp: In method `const class ::d::cField &
>> ::d::My::getitem(int) const': d.cpp:791: no matching function
>> for call to `vector<::d::Item,allocator<::d::Item> > ::at (int
>> &) const'
>>
>> Thanks
>>
>> Andrew
--
Yes, God had a deadline. So he wrote it all in Lisp.