dynamic_cast Problem

Georg C. F. Greve greve@gnu.org
Fri Dec 31 23:54:00 GMT 1999


 || On Thu, 02 Dec 1999 13:34:55 +0000
 || Nathan Sidwell <nathan@acm.org> wrote:

 >> element.cpp:69: cannot dynamic_cast `source' (of type `const class xservices::Element *') to type `class xservices::Logfile *'
 ns> 5.2.7/1 [expr.dynamic.cast]
 ns> 	`The dynamic_cast operator shall not cast away constness'

Damn - I knew it was something obvious... but I just didn´t see it at
that point.

What about creating an error message with a little more content? It is
very easy to overlook this is also an implicit casting away of
constness. Adding something like "change of constness" to the end of
the line would solve the problem.

Thanks for your help,
			Georg

--
Georg C. F. Greve <greve@gnu.org>
"People who fight may lose. People who do not
fight have already lost." -- Bertolt Brecht
-- 
-----BEGIN PGP MESSAGE-----
Version: 2.6.3i
Comment: Processed by Mailcrypt 3.5.4, an Emacs/PGP interface

iQCVAwUBOEZ9Q1ZXgZXDxqJtAQFK+gP/b89XQUTbHfyiWB7EI4pOwOUt7XI1F3+r
6AKNzERoCSMwb9IW9DY7U9oNLKa5DU6CusyD+m6N5Btf0CoAjCKnejsZAbINgykg
ksefKKc0MWyHQjT7LtN8Z82kfJ/YzjccnW7+l5hdsxZMCLXbct1GYjqfzJv96Luh
6j2ojNZrxl8=
=AKB7
-----END PGP MESSAGE-----


More information about the Gcc mailing list