J
Justin S Bayer
Hi group,
I have a template that generates an abstract class, from which I want
to derive new classes which are supposed to implement the abstract
method. This somehow works in the following example:
http://codepad.org/UXl4jQLF
Thing is, I want my method T to work on const objects of the given
type. (Note: I don't want that to be part of the type that I am
specializing for.). So I just put in const everywhere, but it stops
working then:
http://codepad.org/lcy0kDMw
It tells me, that my new class is still abstract - although I have
overwritten the abstract method.
Even more funny, this works perfectly if I use double instead of
double*:
http://codepad.org/7biadxx3
Any help on how I can get the desired behaviour (specializing for
double*, being able to overwrite methods that use this type in
combination with const) and/or explanations why this is not working as
I'd expect it, are greatly appreciated!
-Justin
PS: Tried to google for this - somehow difficult to get the right
query string there, also checked the C++ FAQ Lite. Sorry if this comes
up frequently.
I have a template that generates an abstract class, from which I want
to derive new classes which are supposed to implement the abstract
method. This somehow works in the following example:
http://codepad.org/UXl4jQLF
Thing is, I want my method T to work on const objects of the given
type. (Note: I don't want that to be part of the type that I am
specializing for.). So I just put in const everywhere, but it stops
working then:
http://codepad.org/lcy0kDMw
It tells me, that my new class is still abstract - although I have
overwritten the abstract method.
Even more funny, this works perfectly if I use double instead of
double*:
http://codepad.org/7biadxx3
Any help on how I can get the desired behaviour (specializing for
double*, being able to overwrite methods that use this type in
combination with const) and/or explanations why this is not working as
I'd expect it, are greatly appreciated!
-Justin
PS: Tried to google for this - somehow difficult to get the right
query string there, also checked the C++ FAQ Lite. Sorry if this comes
up frequently.