hash_map error: passing `const lambda_calculus::int_adr' as `this' argument of `const size_t lambda_calculus::int_adr::operator ()(const lambda_calculus::Port *)' discards qualifiers passing `const lambda_calculus::int_adr' as `this' argument of `const size_t lambda_calculus::int_adr::operator ()(const lambda_calculus::Port *)' discards qualifiers

Ricardo Fodra rdfodra@yahoo.com.br
Sat Nov 5 01:25:00 GMT 2005


Having a similar problem here:

  std::set<Person>* _family
  ...
  set<Person>::reverse_iterator iter =
_family->rbegin();
  ++iter;
> iter->setName(NULL);

error: passing `const Person' as `this' argument of
`void Person::setName(char*)' discards qualifiers

Why is the compiler thinking *iter is a "const
Person"? _family is not const and I'm not using a
const_reverse_iterator, although there are some
const_iterator in other parts of the code.

For now I'll just cast the const Person to a Person:

((Person*)(&(*iter)))->setName(NULL);

But I'd like to know how to fix this.

    Ricardo, Brazil.


	



	
		
_______________________________________________________ 
Yahoo! Acesso Grátis: Internet rápida e grátis. 
Instale o discador agora!
http://br.acesso.yahoo.com/



More information about the Gcc-help mailing list