Maybe this has changed since VS 2003 which I'm using at the moment, but I see no
CTimeSpan::operator=()
defined here, so you couldn't possibly inherit from it. The compiler will automatically create an
operator=
for any class that doesn't define one itself, but it will not be virtual, and thus can not be inherited and overridden, only overwritten!
Moreover, even if there were a method
virtual CTimeSpan::operator=(const CTimeSpan&)
then to override it you must use the same types for the parameter, in this case
const CTimeSpan&
, not const
CVoipTimeSpan&
. This would be bad design however, since it would allow assignments of instances of class
CTimeSpan
or other classes derived from it, which are potentially not compatible to
CVoipTimeSpan
. Even if there would be no compatibility issues now, when someone later decides to expand your class
CVoipTimeSpan
, this might create such an incompatibility and thus invalidate not only your implementation of
operator=()
, but also, possibly, many of the places where it has been invoked!
I've already pointed out in another thread of yours how to properly implement
CVoipTimeSpan::operator=(const CVoipTimeSpan&)
, and as far as I can see all other questions have been answered.
On a sidenote, I've seen your question posted at least three times now!
Do not do that! It will just keep people who might be able to help you ignorant of additional information and advice that's already been handed out. Basically you multiply the workload on other people while getting confusing responses to different threads that are based on different assumptions. Instead, just edit your original question!
It's a bit late now. However, do us the favor to at the very least:
- mark all of your threads as answered if your problem is solved, or
- mark all but one of your threads as answered if there are still questions
- edit the original question in each of your threads to make others aware of the duplicate threads, and maybe insert a link to that one thread that you would like any additional answers in.