我继承了吗? [英] Am I inherited?
问题描述
在MyClass类中,我可以想出两种方式
来判断MyClass是否继承了特定的
使用:
1.在ctor args中传递一个合适的bool;
2.使用一个虚拟方法返回,例如,
例如,包含该类的一个siring名字。
还有更好的办法吗?
谢谢,
迈克。
Within class MyClass, I can think of two ways
to tell if MyClass is inherited in a particular
use:
1. pass an appropriate bool in the ctor args;
2. use a virtual method that returns, for
example, a siring containing the class name.
Is there a better way?
Thanks,
Mike.
推荐答案
*迈克 - 电子邮件忽略:
* Mike - EMAIL IGNORED:
在MyClass类中,我可以想到两个方式
判断MyClass是否继承了特定的
使用:
1.在ctor args中传递适当的bool ;
2.使用虚拟方法返回
示例,包含类名称的siring。
有更好的方法吗?
Within class MyClass, I can think of two ways
to tell if MyClass is inherited in a particular
use:
1. pass an appropriate bool in the ctor args;
2. use a virtual method that returns, for
example, a siring containing the class name.
Is there a better way?
设计课程所以它不需要那些知识。
-
答:因为它弄乱了人们通常阅读文字的顺序。
问:为什么这么糟糕?
A:热门发布。
问:usenet和电子邮件中最烦人的事情是什么?
Design the class so it doesn''t need that knowledge.
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
2006年7月22日星期六00:42:59 +0200 ,Alf P. Steinbach写道:
On Sat, 22 Jul 2006 00:42:59 +0200, Alf P. Steinbach wrote:
* Mike - EMAIL IGNORED:
* Mike - EMAIL IGNORED:
>在MyClass类中,我可以想出两种方式来判断MyClass是否继承在特定的
使用中:
1.在ctor args中传递适当的bool;
2.使用一个虚拟方法返回,例如,一个包含类名的siring。
有更好的方法吗?
>Within class MyClass, I can think of two ways
to tell if MyClass is inherited in a particular
use:
1. pass an appropriate bool in the ctor args;
2. use a virtual method that returns, for
example, a siring containing the class name.
Is there a better way?
设计课程,这样就不需要那些知识了。
Design the class so it doesn''t need that knowledge.
这通常是一个好主意;但在这种情况下,它不是。
That is often a good idea; but in this case, it is not.
*迈克 - 电子邮件忽略:
* Mike - EMAIL IGNORED:
2006年7月22日星期六00:42:59 +0200,Alf P. Steinbach写道:
On Sat, 22 Jul 2006 00:42:59 +0200, Alf P. Steinbach wrote:
> * Mike - EMAIL IGNORED:
>* Mike - EMAIL IGNORED:
>>在MyClass类中,我可以想出两种方式来判断MyClass是否在特定的
使用中继承:
> 1.在ctor args中传递适当的bool;
2.使用虚拟方法返回,例如,包含类名的siring。
>有更好的方法吗?
>>Within class MyClass, I can think of two ways
to tell if MyClass is inherited in a particular
use:
1. pass an appropriate bool in the ctor args;
2. use a virtual method that returns, for
example, a siring containing the class name.
Is there a better way?
设计课程,这样就不需要那些知识了。
Design the class so it doesn''t need that knowledge.
这通常是一个好主意;但在这种情况下,它不是。
That is often a good idea; but in this case, it is not.
如果这是真的,这将是有趣的。但是,如果没有一些具体的证据,我不愿意相信没有b $ b。请发一个小例子
编译,或编译错误说明问题。
-
答:因为它弄乱了人们通常阅读文字的顺序。
问:为什么这么糟糕?
A:热门帖子。
问:usenet和电子邮件中最烦人的是什么?
That would be interesting, if true. However, I''m disinclined to believe
that claim without some concrete evidence. Please post a small example
that compiles, or where the compilation error illustrates the problem.
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
这篇关于我继承了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!