C ++中多重继承的限制 [英] Limit of multiple inheritance in C++

查看:92
本文介绍了C ++中多重继承的限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

C ++中多重继承的限制是什么?即,一个类可以继承多少个类?是实现依赖还是对多重继承中可以继承的类的数量施加了限制?

What is the limit of multiple inheritance in C++? i.e, how many classes can a class inherit from? Is it implementation dependent or is there a constraint placed on the number of classes you can inherit from in multiple inheritance?

推荐答案

已定义实现. C ++ 11在标准的实施量部分中给出了建议的最小值:

It's implementation defined. C++11 gives recommended minimums in the Implementation quantities section of the standard:

-直接和间接基类[16 384].
—单个类的直接基类[1 024].
[...]
—类[1 024]的直接和间接虚拟库.

— Direct and indirect base classes [16 384].
— Direct base classes for a single class [1 024].
[...]
— Direct and indirect virtual bases of a class [1 024].

我会说这很慷慨.

这篇关于C ++中多重继承的限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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