[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++ Blues.



Mikko Torni wrote:
>         If you subclass something, and then "overwrite" one of the
>         functions, you don't want the original function to be called,
>         now do you?

What about this case??? 

class Viewport
{
protected:
	...
public:
	...	
	Move(rect &newrect);
	Move(uint x, uint y);
	...
};

class Camera: public Viewport
{
private:
	...
public:
	Move(vector &newloc);
	Move(float x, float y, float z);
};

Here it makes a kindof sense to overwrite the functions. You can move a
camera, you can move 'its' viewport. 

> But I think it is consistent, and rational.

I am not sure that is the case, however at the same time I am sure that
Stroustrup, et al did this for a good reason, if indeed this behavior is
in the standard. I have been unable to find anything on the topic in his
book "C++ Programming Language" 3rd Edition.

Definitely a question for the C++ gurus.
-- 
Hasse Schougaard
hasse@acid.brisnet.org.au