danni.coy Posted October 13, 2011 Share Posted October 13, 2011 supposing I have overridden a function in a subclass is there anyway I can access the superfunctions version of the function. In D I would use the super qualifier. class foo { void do_thing() { // do default stuff } }; class bar : foo { void do_thing() { //handle special case //then handle the general case super.do_thing(); } }; Link to comment
ulf.schroeter Posted October 13, 2011 Share Posted October 13, 2011 Use <base class name>::<overridden function name> syntax class foo { void do_thing() { // do default stuff } }; class bar : foo { void do_thing() { //handle special case //then handle the general case foo::do_thing(); } }; Link to comment
danni.coy Posted October 14, 2011 Author Share Posted October 14, 2011 thankyou very kindly Link to comment
Recommended Posts