P
Paavo K
Hi, can anyone tell what is wrong with following code :
//..Code
class removeTest
{
public:
bool operator()(map<int, string>::value_type &d) const
{
// Just returning false to simplify code..
return false;
}
};
void testFunction()
{
map<int, string> *m = new map<int, string>;
if(m->empty() == false)
{
m->erase(
remove_if(m->begin(),
m->end(),
removeTest()),
m->>end()
);
}
else cout<<"\n Nothing to remove \n";
}
Visual C++ compiler return this message :
c:\microsoft visual studio\vc98\include\algorithm(317) :
error C2582: 'std:air<int const ,class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > >' : 'operator ='
function is unavailable
Thanks in advance!
//..Code
class removeTest
{
public:
bool operator()(map<int, string>::value_type &d) const
{
// Just returning false to simplify code..
return false;
}
};
void testFunction()
{
map<int, string> *m = new map<int, string>;
if(m->empty() == false)
{
m->erase(
remove_if(m->begin(),
m->end(),
removeTest()),
m->>end()
);
}
else cout<<"\n Nothing to remove \n";
}
Visual C++ compiler return this message :
c:\microsoft visual studio\vc98\include\algorithm(317) :
error C2582: 'std:air<int const ,class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > >' : 'operator ='
function is unavailable
Thanks in advance!