class vs. typename [英] class vs. typename
问题描述
两个关键词之间的语义/句法差异
" class"和typename (除了不同的拼写)?
-
祝你好运,
Alex。
PS。要给我发电子邮件,请删除loeschedies。从给出的电子邮件地址。
What''s the semantical/syntactical difference between two keywords
"class" and "typename" (apart from different spelling)?
--
Best regards,
Alex.
PS. To email me, remove "loeschedies" from the email address given.
推荐答案
" Alexander Malkis" <人***************** @ stone.cs.uni-sb.de>在消息中写道
新闻:c4 ********** @ hades.rz.uni-saarland.de ...
"Alexander Malkis" <al*****************@stone.cs.uni-sb.de> wrote in message
news:c4**********@hades.rz.uni-saarland.de...
什么是两个关键词之间的语义/句法差异
class和typename (除了不同的拼写)?
What''s the semantical/syntactical difference between two keywords
"class" and "typename" (apart from different spelling)?
完全没有。
我认为引入了typename,因为并非所有模板参数都是
班。
john
None at all.
I think typename was introduced because not all template parameters are
classes.
john
Alexander Malkis ; <人***************** @ stone.cs.uni-sb.de>在消息中写道
新闻:c4 ********** @ hades.rz.uni-saarland.de ...
"Alexander Malkis" <al*****************@stone.cs.uni-sb.de> wrote in message
news:c4**********@hades.rz.uni-saarland.de...
什么是两个关键词之间的语义/句法差异
class和typename (除了不同的拼写)?
What''s the semantical/syntactical difference between two keywords
"class" and "typename" (apart from different spelling)?
完全没有。
我认为引入了typename,因为并非所有模板参数都是
班。
john
None at all.
I think typename was introduced because not all template parameters are
classes.
john
John Harrison写道:
John Harrison wrote:
亚历山大·马尔基斯 <人***************** @ stone.cs.uni-sb.de>在
消息新闻中写道:c4 ********** @ hades.rz.uni-saarland.de ...
"Alexander Malkis" <al*****************@stone.cs.uni-sb.de> wrote in
message news:c4**********@hades.rz.uni-saarland.de...
语义/句法差异是什么?两个关键词之间
class和typename (除了不同的拼写)?
What''s the semantical/syntactical difference between two keywords
"class" and "typename" (apart from different spelling)?
完全没有。
我认为引入了typename,因为并非所有模板参数都是
类。 />
john
None at all.
I think typename was introduced because not all template parameters are
classes.
john
我相信我们需要将讨论限制在模板参数中,以便
来保存。这来自C ++标准:
"
模板参数中的类和类型名之间没有语义差异。"
只是迂腐。
-
p-> m ==(* p).m == p [0]。 m
http://www.kdevelop.org
http://www.suse.com
http://www.mozilla.org
I believe we need to restrict the discussion to template parameters in order
for that to hold. This is from the C++ Standard:
"There is no semantic difference between class and typename in a
template-parameter."
Just being pedantic.
--
p->m == (*p).m == p[0].m
http://www.kdevelop.org
http://www.suse.com
http://www.mozilla.org
这篇关于class vs. typename的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!