Open xmh0511 opened 2 years ago
@jensmaurer CWG2584 only covers the first case(namely, whether two types are equivalent). The second case is not covered(namely, whether two names involving template parameters are the same).
I've fixed CWG2584.
Thanks. Please add T
vs. T&&
example(if possible). The current added example decltype(T::foo)
and decltype(U::foo)
may arguably be said to that T::foo
and U::foo
thereof are expressions(involving template parameters). I want to say T
and T&&
are just type-specifiers that don't touch expressions at all, which can directly expose the subject.
Done.
Thank you.
we define whether two types are equivalent in [temp.over.link] p6, which says
Consider this example:
In this example, their return types are
T
andT&&
, which involve template parameters. However,T
andT&&
are not expressions anyway. According to grammar, they are defined as type-specifier. So, whether two function templates correspond relies on the correct definition of [temp.over.link], the latter seems to be a bit clear in its definition.Another special case is the conversion function template whose name involves template parameter
Such two conversion function templates' names are
operator T
andoperator T&&
, respectively. whether they declare the same name or not is unclear in this document. For this issue, I think we may clarify it with the help of equivalent return types.