通用性是*不是*模板 [英] Genericity is *not* templates

查看:81
本文介绍了通用性是*不是*模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据C ++ FAQ Lite:

http:// www .parashift.com /

[34.11]什么是通用性?


另一种说法, ;类模板。


不要与一般性混淆

(这意味着避免过于具体的解决方案),

" genericity"表示类模板。


这是*不正确。

类模板*不*通常是通用的。

通常情况下,类模板仅用于为一组受限制的类型生成模板类



只有用于生成模板类的类模板

for * all *类型是真正的通用。

例如,标准的矢量类模板是通用的,但是标准的valarry类模板是*不是*泛型的/>
因为它只对数字类型有意义。

According to the C++ FAQ Lite:

http://www.parashift.com/

[34.11] What is "genericity"?

Yet another way to say, "class templates."

Not to be confused with "generality"
(which just means avoiding solutions which are overly specific),
"genericity" means class templates.

This is *not* correct.
Class templates are *not* generally generic.
Usually, class templates are only be used to generate template classes
for a restricted set of types.
Only class templates which are designed to generate template classes
for *all* types are truly generic.
The standard vector class template, for example, is generic but
the standard valarry class template is *not* generic
because it only makes sense for numeric types.

推荐答案

E. Robert Tisdale写道:
E. Robert Tisdale wrote:
根据C ++ FAQ Lite:

http://www.parashift.com/
[34.11]什么是通用性?

又一个方式,类模板。

不要与一般性混淆
(这只是意味着避免过于具体的解决方案),
泛型"表示类模板。

这不是*正确。
类模板*通常不是通用的。
通常,类模板仅用于生成模板类
对于一组受限制的类型。
只有用于生成* all *类型的模板类的类模板才是真正通用的。
标准的矢量类模板,例如,通用但是标准的valarry类模板是* not * generic
因为它只适用于数字类型。
According to the C++ FAQ Lite:

http://www.parashift.com/

[34.11] What is "genericity"?

Yet another way to say, "class templates."

Not to be confused with "generality"
(which just means avoiding solutions which are overly specific),
"genericity" means class templates.

This is *not* correct.
Class templates are *not* generally generic.
Usually, class templates are only be used to generate template classes
for a restricted set of types.
Only class templates which are designed to generate template classes
for *all* types are truly generic.
The standard vector class template, for example, is generic but
the standard valarry class template is *not* generic
because it only makes sense for numeric types.




所以,你是什么告诉我们是否有通用模板和品牌(TM)

模板? :-)


说真的,我觉得你的观察很有意思。

的解释是通用性的含义是你自己的,还是已建立

权限?

-

p-> m ==(* p).m == p [0] .m
http://www.kdevelop.org
http://www.suse.com
http:/ /www.mozilla.org



So, what you''re telling us is there are generic templates and branded(TM)
templates? :-)

Seriously, I find your observation interesting. Is this interpretation of
the meaning of ''genericity'' your own, or is there an ''established
authority''?
--
p->m == (*p).m == p[0].m
http://www.kdevelop.org
http://www.suse.com
http://www.mozilla.org


E. Robert Tisdale写道:
E. Robert Tisdale wrote:
根据C ++ FAQ Lite:

http://www.parashift.com/
[34.11]什么是通用性?

又一个方式,类模板。

不要与一般性混淆
(这只是意味着避免过于具体的解决方案),
泛型"表示类模板。

这不是*正确。
类模板*通常不是通用的。
通常,类模板仅用于生成模板类
对于一组受限制的类型。
只有用于生成* all *类型的模板类的类模板才是真正通用的。
标准的矢量类模板,例如,通用但是标准的valarry类模板是* not * generic
因为它只适用于数字类型。
According to the C++ FAQ Lite:

http://www.parashift.com/

[34.11] What is "genericity"?

Yet another way to say, "class templates."

Not to be confused with "generality"
(which just means avoiding solutions which are overly specific),
"genericity" means class templates.

This is *not* correct.
Class templates are *not* generally generic.
Usually, class templates are only be used to generate template classes
for a restricted set of types.
Only class templates which are designed to generate template classes
for *all* types are truly generic.
The standard vector class template, for example, is generic but
the standard valarry class template is *not* generic
because it only makes sense for numeric types.




所以,你是什么告诉我们是否有通用模板和品牌(TM)

模板? :-)


说真的,我觉得你的观察很有意思。

的解释是通用性的含义是你自己的,还是已建立

权限?

-

p-> m ==(* p).m == p [0] .m
http://www.kdevelop.org
http://www.suse.com
http:/ /www.mozilla.org



So, what you''re telling us is there are generic templates and branded(TM)
templates? :-)

Seriously, I find your observation interesting. Is this interpretation of
the meaning of ''genericity'' your own, or is there an ''established
authority''?
--
p->m == (*p).m == p[0].m
http://www.kdevelop.org
http://www.suse.com
http://www.mozilla.org


Steven T. Hatton写道:
Steven T. Hatton wrote:
E. Robert Tisdale写道:

E. Robert Tisdale wrote:

根据C ++ FAQ Lite:

http://www.parashift.com/

[34.11]什么是通用性?

又一种方式说,类模板。

不要与一般性混淆
(这意味着避免解决方案)过于具体的tions,
通用性表示类模板。

这不是*正确。
类模板*通常不是通用的。
通常,类模板仅用于生成模板类
对于一组受限制的类型。
只有用于生成* all *类型的模板类的类模板才是真正通用的。
标准的矢量类模板,例如,通用但是标准的valarry类模板是* not * generic
因为它只对数字类型有意义。
According to the C++ FAQ Lite:

http://www.parashift.com/

[34.11] What is "genericity"?

Yet another way to say, "class templates."

Not to be confused with "generality"
(which just means avoiding solutions which are overly specific),
"genericity" means class templates.

This is *not* correct.
Class templates are *not* generally generic.
Usually, class templates are only be used to generate template classes
for a restricted set of types.
Only class templates which are designed to generate template classes
for *all* types are truly generic.
The standard vector class template, for example, is generic but
the standard valarry class template is *not* generic
because it only makes sense for numeric types.



所以,你在告诉我们什么是否有通用模板和品牌(TM)模板? :-)

说真的,我发现你的观察很有意思。
这种对通用性含义的解释是你自己的,
还是有一个'已建立的权威''?


So, what you''re telling us is there are
generic templates and branded(TM) templates? :-)

Seriously, I find your observation interesting.
Is this interpretation of the meaning of ''genericity'' your own,
or is there an ''established authority''?




选择你选择的字典。我使用

美国遗产?英语词典:

第四版:

http://www.bartleby.com/61/

通用


目标:1。关于或描述整个团体或班级;

一般。查看一般的同义词。


同义词:一般,普通,通用,通用这些形容词意味着属于,涉及或影响整体的
:一般福利;

a共同的敌人;一般的相似;普遍的军事征兵。



Pick the dictionary of your choice. I use
The American Heritage? Dictionary of the English Language:
Fourth Edition:

http://www.bartleby.com/61/

generic

ADJECTIVE:1. Relating to or descriptive of an entire group or class;
general. See synonyms at general.

SYNONYMS:general, common, generic, universal These adjectives mean
belonging to, relating to, or affecting the whole: the general welfare;
a common enemy; generic likenesses; universal military conscription.


这篇关于通用性是*不是*模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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