Created
July 20, 2016 09:26
-
-
Save condy0919/5dc8cb0387c5246fd68e93048caedd24 to your computer and use it in GitHub Desktop.
This file contains 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 <utility> | |
using namespace std; | |
auto l = [](char, int) { return 1.0; }; | |
struct foo { | |
int operator()(int, char) { return 0; } | |
}; | |
template <typename C, typename T> | |
auto prototype_of_impl(T C::* const) -> std::decay_t<T>; | |
//template <typename C, typename T> | |
//auto prototype_of_impl(T C::*) -> std::decay_t<T>; | |
template <typename T> | |
struct prototype_of { | |
using type = decltype(prototype_of_impl(&T::operator())); | |
}; | |
int main() { | |
//using T = prototype_of<decltype(l)>::type; | |
using F = prototype_of<foo>::type; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment