Skip to content

Instantly share code, notes, and snippets.

@malfet
Created October 7, 2021 16:41
Show Gist options
  • Save malfet/c83b9ebd35730ebf8bac7af42682ea37 to your computer and use it in GitHub Desktop.
Save malfet/c83b9ebd35730ebf8bac7af42682ea37 to your computer and use it in GitHub Desktop.
Prints name of the template argument
#include <iostream>
#include <string>
template<typename T>
struct WhatsMyName {
WhatsMyName() {
std::cout << __PRETTY_FUNCTION__ << std::endl;
}
};
WhatsMyName<std::string> _printer;
int main(void) {
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment