This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
What's wrong with vector<>::at(int) ?
- To: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Subject: What's wrong with vector<>::at(int) ?
- From: Andrew Guts <andr at fe-club dot net>
- Date: Mon, 29 Oct 2001 13:39:54 +0200
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