<instance>& == const <instance>&

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have the same problem as mentioned last week, but I can't cast the 'const'
out using void pointers or a simple cast like

  list<Person> Persons;
  list<Person> :: iterator Piter;
  Person * MyPerson;

 for ( list < Person > :: iterator Piter = Persons -> begin(); Piter !=
Persons -> end(); Piter++ ) {
if (  ....  ) {
// Persons -> erase ( * ( static_cast<list<Person> :: iterator > (
Piter ) ) ); // list.tcc :: 97
Persons -> remove ( * ( static_cast<list<Person> :: iterator > (
Piter ) ) ); // Stroustrup, p 473, 414, 130

/*
* This gives:
* /usr/include/g++/bits/list.tcc: In member function `void std::list<_Tp,
* _Alloc>::remove(const _Tp&) [with _Tp = Person, _Alloc =
* std::allocator<Person>]':
* ...
* /usr/include/g++/bits/list.tcc:189: error: no match for `Person& == const
Person&' operator
*/

Can anybody tell  me how to solve this?
Thanks

Nieuwenhuizen
2005-07-21


----------------------------------------------------------------------------
--


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux