Proposed resolution (04/01): If a typedef TD names a type "reference to
cv1 S ," an attempt to create the type
"reference to cv2 TD " creates the type
"reference to cv12" S ," where cv12 is the
union of the cv-qualifiers cv1 and cv2.
Redundant qualifiers are ignored. [Example:
If a template-argument for a template-parameter
T names a type "reference to cv1 S ,"
an attempt to create the type "reference to cv2 T "
creates the type "reference to cv12 S ," where
cv12 is the union of the cv-qualifiers cv1 and
cv2. Redundant cv-qualifiers are ignored.
[Example:
(See also paper J16/00-0022 = WG21 N1245.)
int i;
typedef int& RI;
RI& r = i; // r has the type int&
const RI& r = i; // r has the type const int&
—end example]
template <class T> class X {
f(const T&);
/* ... */
};
X<int&> x; // X<int&>::f has the parameter type const int&
—end example]
Attempting to create
a reference to a reference type or a
reference to void .