You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
struct A { friend bool operator==(const A&, const A&) = default; };
template<const X& x, int i, A a> void f() {
i++; // error: change of template-parameter value
&x; // OK
&i; // error: address of non-reference template-parameter
&a; // OK
int& ri = i; // error: non-const reference bound to temporary
const int& cri = i; // OK: const reference bound to temporary
const A& ra = a; // OK: const reference bound to a template parameter object
}
I think it's missing a definition of what X is.
It might be using X = int;, or it might be template<class> struct X {};.
(The latter is possible, according to [temp.param]/4 and [dcl.type.class.deduct]/2.)
The text was updated successfully, but these errors were encountered:
[temp.param]/6 contains the following example:
I think it's missing a definition of what
X
is.It might be
using X = int;
, or it might betemplate<class> struct X {};
.(The latter is possible, according to [temp.param]/4 and [dcl.type.class.deduct]/2.)
The text was updated successfully, but these errors were encountered: