C++ Types Impossible to Name
Posted
by
Kirakun
on Stack Overflow
See other posts from Stack Overflow
or by Kirakun
Published on 2011-03-05T22:53:03Z
Indexed on
2011/03/05
23:25 UTC
Read the original article
Hit count: 179
While reading Wikipedia's page on decltype, I was curious about the statement,
Its [decltype's] primary intended use is in generic programming, where it is often difficult, or even impossible, to name types that depend on template parameters.
While I can understand the difficulty part of that statement, what is an example where there is a need to name a type that cannot be named under C++03?
EDIT: My point is that since everything in C++ has a declaration of types. Why would there ever be a case where it is impossible to name a type? Furthermore, aren't trait classes designed to yield type informations? Could trait classes be an alternative to decltype
?
© Stack Overflow or respective owner