 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
silverburgh.meryl@gmail.c Guest
|
Posted: Sun Jan 29, 2006 7:00 pm Post subject: STL remove compile error |
|
|
Hi,
I have this piece of code which calls STL remove():
_aList.erase(remove(_aList.begin(), _aList.end(), bd), _aList.end());
where _aList is a 'vector<A*>' and bd is 'A*'
But i get this compile error:
Test.cpp:199: error: no matching function for call to
'Test::remove(__gnu_cxx::__normal_iterator<A**, std::vector<A*,
std::allocator<A*> > >, __gnu_cxx::__normal_iterator<A**,
std::vector<A*, std::allocator<A*> > >, A*&)'
And I have this in my Test.cpp file:
#include <algorithm>
#include <functional>
#include <numeric>
using namespace std;
Thanks for any help |
|
| Back to top |
|
 |
Victor Bazarov Guest
|
Posted: Sun Jan 29, 2006 8:00 pm Post subject: Re: STL remove compile error |
|
|
silverburgh.meryl (AT) gmail (DOT) com wrote:
| Quote: | I have this piece of code which calls STL remove():
_aList.erase(remove(_aList.begin(), _aList.end(), bd), _aList.end());
where _aList is a 'vector<A*>' and bd is 'A*'
But i get this compile error:
Test.cpp:199: error: no matching function for call to
'Test::remove(__gnu_cxx::__normal_iterator<A**, std::vector<A*,
|
This suggests that the compiler is trying to resolve it to Test::remove.
Is there a 'remove' member in 'Test'? What *is* 'Test'? Why not simply
post the _entire_ code? Why do you want us to guess?
Try to write "::remove(" instead of simply "remove("... Or drop the
'using' directive and explicitly prepend all standard names with 'std::'.
| Quote: | std::allocator<A*> > >, __gnu_cxx::__normal_iterator<A**,
std::vector<A*, std::allocator<A*> > >, A*&)'
And I have this in my Test.cpp file:
#include <algorithm
#include <functional
#include <numeric
using namespace std;
|
Apparently that's not enough.
V
--
Please remove capital As from my address when replying by mail |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|