Re: 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

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

 



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/


[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