Question Details

No question body available.

Tags

c++ c++20 c++-concepts

Answers (1)

Accepted Answer Available
Accepted Answer
August 16, 2025 Score: 7 Rep: 312,411 Quality: Expert Completeness: 50%

What does this T&& t parameter mean? Is it a universal reference?

No, it's not a universal (forwarding) reference. A forwarding reference is only in the specific case where you have a deduced parameter of type T&&. That's not the case here — nothing is deduced.

For Swappable, t and u are of type int&&. For Swappable, they are both of type int&.

Similar to:

template 
struct X {
    void f(T&& t);

template void g(U&& u); };

u is a forwarding reference, t is not.