C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

STL remove compile error

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++)
View previous topic :: View next topic  
Author Message
silverburgh.meryl@gmail.c
Guest





PostPosted: Sun Jan 29, 2006 7:00 pm    Post subject: STL remove compile error Reply with quote



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





PostPosted: Sun Jan 29, 2006 8:00 pm    Post subject: Re: STL remove compile error Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.