473,394 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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

Jan 29 '06 #1
1 1651
si***************@gmail.com wrote:
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::'.
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
Jan 29 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Venkat | last post by:
Hi All, Currently i guess rename and remove are not supported using fstream. How do i rename or remove a file? regards, Venkat
1
by: charismatic_evangelist | last post by:
I am trying to write a Windows Service in C# .NET Version 1.1. I followed Microsoft's directions: ...
4
by: FullBandwidth | last post by:
I have been perusing various blogs and MSDN pages discussing the use of event properties and the EventHandlerList class. I don't believe there's anything special about the EventHandlerList class in...
0
by: sangitayadavgr8 | last post by:
Hi, My database has only one table which is segmented and has wround 20 M rows. This tablespace has 2 VSAM datasets A001 and A002 at the source and also in the target. I am using the image...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.