-
October 30th, 2009, 03:53 AM
#1
[RESOLVED] overwrite virtual template methods
Hi Folks,
I've got a template and the relevant code looks like this:
----
public:
virtual bool IsValid () const
{
return IsValid (mMemberValue);
}
protected:
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
chabba
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|