Created
January 14, 2018 15:43
-
-
Save likejazz/48c907301dfde3c024d699d875d3846c 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 <iostream> | |
template<class T> | |
constexpr | |
std::string_view | |
type_name() { | |
using namespace std; | |
string_view p = __PRETTY_FUNCTION__; | |
return string_view(p.data() + 34, p.size() - 34 - 1); | |
} | |
// -- | |
int main() { | |
char c = 'a'; | |
std::cout << type_name<decltype(c)>() << std::endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment