Bjarne Stroustrup mentions in Design and Evolution of C++ that super as a keyword was considered by the ISO C++ Standards committee the first time C++ was standardized.

Dag Bruck proposed this extension, calling the base class "inherited." The proposal mentioned the multiple inheritance issue, and would have flagged ambiguous uses. Even Stroustrup was convinced.

After discussion, Dag Bruck (yes, the same person making the proposal) wrote that the proposal was implementable, technically sound, and free of major flaws, and handled multiple inheritance. On the other hand, there wasn't enough bang for the buck, and the committee should handle a thornier problem.

Michael Tiemann arrived late, and then showed that a typedef'ed super would work just fine, using the same technique that was asked about in this post.

So, no, this will probably never get standardized.

If you don't have a copy, Design and Evolution is well worth the cover price. Used copies can be had for about $10.

Answer from Max Lybbert on Stack Overflow
Top answer
1 of 16
182

Bjarne Stroustrup mentions in Design and Evolution of C++ that super as a keyword was considered by the ISO C++ Standards committee the first time C++ was standardized.

Dag Bruck proposed this extension, calling the base class "inherited." The proposal mentioned the multiple inheritance issue, and would have flagged ambiguous uses. Even Stroustrup was convinced.

After discussion, Dag Bruck (yes, the same person making the proposal) wrote that the proposal was implementable, technically sound, and free of major flaws, and handled multiple inheritance. On the other hand, there wasn't enough bang for the buck, and the committee should handle a thornier problem.

Michael Tiemann arrived late, and then showed that a typedef'ed super would work just fine, using the same technique that was asked about in this post.

So, no, this will probably never get standardized.

If you don't have a copy, Design and Evolution is well worth the cover price. Used copies can be had for about $10.

2 of 16
116

I've always used "inherited" rather than super. (Probably due to a Delphi background), and I always make it private, to avoid the problem when the 'inherited' is erroneously omitted from a class but a subclass tries to use it.

class MyClass : public MyBase
{
private:  // Prevents erroneous use by other classes.
  typedef MyBase inherited;
...

My standard 'code template' for creating new classes includes the typedef, so I have little opportunity to accidentally omit it.

I don't think the chained "super::super" suggestion is a good idea- If you're doing that, you're probably tied in very hard to a particular hierarchy, and changing it will likely break stuff badly.

🌐
Runestone Academy
runestone.academy › ns › books › published › csawesome › Unit9-Inheritance › topic-9-4-super.html
9.4. super Keyword — CSAwesome v1
super.method(); calls a superclass’ method (not constructors). The keyword super is very useful in allowing us to first execute the superclass method and then add on to it in the subclass.
🌐
Quora
quora.com › What-is-the-purpose-of-the-super-method-in-an-object-oriented-programming-language-like-C-or-Java
What is the purpose of the super() method in an object oriented programming language like C++ or Java? - Quora
Answer (1 of 2): It represents a call to the constructor of the super class, with any arguments required - possibly none - by that constructor. The super class constructor always needs to get called once from every subclass constructor, either ...
🌐
Hacker News
news.ycombinator.com › item
How to Emulate the “super” Keyword in C++ | Hacker News
October 4, 2017 - As others have pointed out, putting the keyword in the base class is Highly Questionable · I've also seen inconsistency in various inheritance diagrams; sometimes the arrow points to the child, sometimes to the parent
🌐
Microsoft Learn
learn.microsoft.com › en-us › cpp › cpp › super
__super | Microsoft Learn
// deriv_super.cpp // compile with: /c struct B1 { void mf(int) {} }; struct B2 { void mf(short) {} void mf(char) {} }; struct D : B1, B2 { void mf(short) { __super::mf(1); // Calls B1::mf(int) __super::mf('s'); // Calls B2::mf(char) } }; END Microsoft Specific · Keywords ·
🌐
Unreal Engine
forums.unrealengine.com › development › programming & scripting › c++
What i sthe Super keyword and how its work - C++ - Epic Developer Community Forums
August 30, 2018 - Hi. Can someone tell me how the Super keyword works? As I remember this is not how we call method from parent class in c++? pls help
🌐
LinuxQuestions.org
linuxquestions.org › questions › programming-9 › c-super-keyword-273766
c++ super keyword
Is super ( http://msdn.microsoft.com/library/de.../key_s-z_1.asp ) a microsoft specific keyword? More importantly, if I use it, will gcc recognize it?
Find elsewhere
🌐
TutorialsPoint
tutorialspoint.com › equivalent-of-java-super-keyword-in-chash
Equivalent of Java Super Keyword in C#
It is used to invoke the superclass constructor from subclass. C# base keyword is used to access the constructors and methods of base class.
🌐
Edureka Community
edureka.co › home › community › categories › c++ › using super in c
Using super in C | Edureka Community
July 13, 2022 - The following phrase is part of my coding approach: class Derived : public Base { public : ... or is its current use through a typedef sufficien?
🌐
Cplusplus
cplusplus.com › forum › general › 4579
Inheritance and the keyword SUPER - C++ Forum
Given an object of type cat, calling feed() on that object would call cat::feed(). If feed() were not pure in the base, then given an object of type animal (and not cat), calling feed() on that object would call animal::feed().
🌐
Linux Hint
linuxhint.com › emulate-super-keyword-cpp
How to Emulate the super Keyword in C++
Linux Hint LLC, [email protected] 1210 Kelly Park Circle, Morgan Hill, CA 95037 Privacy Policy and Terms of Use
🌐
Fiveable
library.fiveable.me › ap-comp-sci-a › unit-9 › super-keyword › study-guide › KFSf1qj68MN8JgmRHWzC
Super Keyword - AP CSA Study Guide | Fiveable | Fiveable
Cram for AP Computer Science A – Inheritance with Fiveable Study Guides. Includes key concepts, notes, vocab, and practice quizzes.
🌐
Fluent C++
fluentcpp.com › home › how to emulate the “super” keyword in c++
How to Emulate The "super" Keyword In C++ - Fluent C++
June 1, 2018 - But for bases classes with a long name, repeating it in the body of the derived class adds a lot of clutter to it. And C++ doesn’t have a super or base keyword to designate “the base class”, like C# and Java do.
🌐
Cprogramming
cboard.cprogramming.com › cplusplus-programming › 108276-cplusplus-equivalent-super.html
C++ equivalent of super
If you are designing class B, one of the design decisions is that A is its base. So it is just as easy to call A::foo() as super::foo(). ... @elkvis, tabstop If I've now inherited and overridden draw() from Polygon in Rectangle, won't the call to Polygon::draw resolve to Rectangle::draw?
🌐
Hacker News
news.ycombinator.com › item
> It's true that C++ doesn't have this problem, because it has no super keyword ... | Hacker News
August 23, 2020 - It's emphatically not "having a super keyword" or not having it. That's a red herring. Visual C++ has __super and yet it doesn't suffer from this: it errors with "ambiguous call to overloaded function" when there are multiple candidates · There's a lot more I could say about this (frankly ...
🌐
Cplusplus
cplusplus.com › forum › general › 81110
C++ vs Java (Calling super constructor) - C++ Forum
Remember, in C++ a class is not limited to having just one parent, so there is no special word for *the* parent. Just use the name of the particular base class you want to initialize in the constructor. ... This constructs a temporary Super object in the Sub constructor which is immediately destroyed.
🌐
Medium
medium.com › @koresar › in-some-c-implementations-there-is-super-832419f65ab1
In some C++ implementations there is __super. | by Vasyl Boroviak | Medium
April 3, 2018 - In some C++ implementations there is __super. Also, when doing multiple inheritance in C++ you can call either of the super classes methods. See here. Also, the “instanceof” in C++ can be reached by using dynamic_cast.