A
Alexander Malkis
What's the semantical/syntactical difference between two keywords
"class" and "typename" (apart from different spelling)?
"class" and "typename" (apart from different spelling)?
Alexander Malkis said:What's the semantical/syntactical difference between two keywords
"class" and "typename" (apart from different spelling)?
I believe we need to restrict the discussion to template parameters in orderJohn said:None at all.
I think typename was introduced because not all template parameters are
classes.
john
Actually it was introduced in order to inform the compiler that a nameNone at all.
I think typename was introduced because not all template parameters are
classes.
Alexander said:What's the semantical/syntactical difference between two keywords
"class" and "typename" (apart from different spelling)?
I don't know if anybody mentioned this, I just learned it. It is discussedAlexander said:What's the semantical/syntactical difference between two keywords
"class" and "typename" (apart from different spelling)?
Steven T. Hatton said:I don't know if anybody mentioned this, I just learned it. It is discussed
in TC++PL(SE) Appendix C.13.5. Stroustrup explains it as a way of
disambiguating statements in template declarations. For example
template<class C> void h(C& v)
{
typename C::iterator i = v.begin();
}
--
STH
Hatton's Law: "There is only One inviolable Law"
KDevelop: http://www.kdevelop.org SuSE: http://www.suse.com
Mozilla: http://www.mozilla.org
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.