October 30th, 2009, 04:53 AM
[RESOLVED] overwrite virtual template methods
I've got a template and the relevant code looks like this:
virtual bool IsValid () const
return IsValid (mMemberValue);
virtual bool IsValid (int value)const
//Here ist a little code testing value.
IsValid() does no more than calling IsValid(int).
If I try now to overwrite IsValid(), the compiler complains, that my new IsValid() hides IsValid(int).
If I try to overwrite IsValid(int), it complains about hiding IsValid().
As we're using Borland C++ 6, I know I could make the compiler stop complaining by using HIDESBASE.
But this - IMHO - strange warning makes me a little bit nervous. I think the compiler should be able to differ both methods by signature - as it does with methods in "real" classes.
Or am I seeing sth. wrong?
Thanks in advance
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!