#include <iostream>
#include <type_traits>
#include <utility>
using namespace std;
template<typename T>
requires is_rvalue_reference_v<T>
void f( T &&v )
{
T v2( forward<T>( v ) );
cout << v << endl;
cout << v2 << endl;
}
int main()
{
string str = "hello world";
f( move( str ) );
}
Why does this not compile until I remove the requires clause or: why doesn't the compiler notice that T is r-value-reference ?