Why `is_constructible <function <int (int)>, int (*) (int, int)> :: value` is true in VC2015RC

#include <functional> using namespace std; int main() { static_assert(is_constructible<function<int(int)>, int(*)(int,int)>::value, "error"); } 

The code does not compile with GCC and Clang, but is transmitted with Visual C ++ 2015 RC.

Is this standard compatible behavior or just a bug?

+1
source share
1 answer

std::function constructor used to accept everything under the sun (it was template<class F> function(F f) ).

He then received a restriction in the standard ( LWG issue 2132 ), but to implement this limitation, an SFINAE expression is required, which Microsoft Compiler does not yet support .

+4
source

Source: https://habr.com/ru/post/1234242/


All Articles