Created
May 28, 2015 05:52
-
-
Save windoze/865eaf7910f878c63e06 to your computer and use it in GitHub Desktop.
VC Quirks 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <functional> | |
typedef std::function<int(int)> fii; | |
template<typename Fn> | |
auto f(Fn fn) | |
-> typename std::enable_if<!std::is_constructible<fii, Fn>::value, int>::type | |
{ return 10; } | |
int f(fii) { return 20; } | |
int xx(int, int) { return 0; } | |
int main() { | |
std::cout<< f(xx) << std::endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment