The following program's output seems to contradict itself:
#include <type_traits>
#include <iostream>
#include <functional>
void foo(int&){ std::cout << "called\n"; }
int main() {
int a;
foo(a);
std::cout << std::is_invocable_v<decltype(foo), decltype(a)> << std::endl;
std::invoke(foo, a);
}
The output is:
called
0
called
Which seems to me to be invoking a function that is not invocable? What is going on here?