Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //test.cpp
- #include <type_traits>
- double* func() {}
- static_assert(std::is_same<double*(*)(), decltype(func)>::value, "");
- int main() {}
- g++ -std=c++11 -c test.cpp
- test4.cpp:6:1: error: static assertion failed:
- static_assert(std::is_same<double*(*)(), decltype(func)>::value, "");
- ^
- double* func() {}
- auto ptr = func;
- static_assert(std::is_same<double*(), decltype(func)>::value, "");
- static_assert(std::is_same<double*(*)(), decltype(ptr)>::value, "");
- int main() {}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement