“super”的C ++等价物 [英] C++ equivalent of "super"?

查看:138
本文介绍了“super”的C ++等价物的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Java中,不使用scope操作符,而是使用ex:

  C ++  - > GenericBase :: SomeVirtualFunction(); 
Java - > super.someVirtualMethod();

在C ++中有这样的东西,或者这在C ++中没有意义,因为多重继承? / p>

感谢

解决方案

http://stackoverflow.com/questions/180601/using-super-in-c\">在每个类中定义一个超级typedef 。


In Java, instead of using the scope operator, super is used ex:

C++ -> GenericBase::SomeVirtualFunction();
Java -> super.someVirtualMethod();

Is there something like this in C++ or does this not make sense in C++ because of multiple inheritance?

Thanks

解决方案

There is a convention of defining a super typedef in every class.

这篇关于“super”的C ++等价物的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆