I am using VS 2015 (update 3) to compile the following code:
#include <codecvt>
#include <cctype>
#include <functional>
int main()
{
std::function<int(int)> fn = std::isspace;
}
If I use VC ++ to compile it, that's fine. However, if I changed the compiler to Visual Studio 2015 - Clang with Microsoft CodeGen (v140_clang_c2)in Visual Studio, clang reports an error:
main.cpp (7,26): error: no viable conversion from '' to 'std :: function'
std :: function fn = std :: isspace;
More surprisingly, if I comment on the first line as follows, clang will also be fine.
#include <cctype>
#include <functional>
int main()
{
std::function<int(int)> fn = std::isspace;
}
What is the reason?
source
share