#include <iostream>
#include <type_traits>
#include <iomanip>
using namespace std;
template<typename T>
bool f(T&& v)
{
return is_function_v<decltype(forward<T>(v))>;
}
int main()
{
cout << boolalpha
<< is_function_v<decltype(setw)>
<< endl;
cout << boolalpha
<< f(setw)
<< endl;
return 0;
}
The outout is: (clang 6.0 & gcc 8.0)
>
true
false
But the result I expect should be:
>
true
true
Why does std::is_function_v not work as expected?