Follow-up: Missing C++ Operator

I mentioned before that I think there needs to be an operator for expressly stating when you mean to replace a pre-existing virtual function in a descendant class. I noticed that C++ is preparing for the C++0x (they are aiming for C++09) standard which includes some very nice improvements (formalized hash tables, regular expressions, library recognition of the Container concept to simplify many STL operations).

Realizing that a working group is in-progress I decided I might as well throw my idea into the mix, and wrote a quick email to C++’s daddy, Bjourne Stroustrop.

I was rather surprised by how quickly he replied and then embarrased at my mistake :)

This has of course been discussed for decades, see for example D&E. Your suggested variant is very nice, but it won’t satisfy those who insists that the main problem is accidentally overriding using no keyword. Also, of course, since you are not overloading, the keyword would have to be something like “override”.

I have some more thoughts on the idea, but I’ll go away and think it through further before maybe trying to present my full idea to someone who has already tried to get a similar idea through – maybe adding a name to the proposal will give it a little extra muscle.

One Comment

Ah, template typedefs… :-)

Leave a Reply

Name and email address are required. Your email address will not be published.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

You may use these HTML tags and attributes:

<a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <pre> <q cite=""> <s> <strike> <strong> 

%d bloggers like this: