Skip to content

Instantly share code, notes, and snippets.

@cyrus-and
Created August 4, 2017 09:44
Show Gist options
  • Save cyrus-and/08c41397c02936b6fceb13c976a74bab to your computer and use it in GitHub Desktop.
Save cyrus-and/08c41397c02936b6fceb13c976a74bab to your computer and use it in GitHub Desktop.
C++ debug type prints
#include <iostream>
template <typename T>
void print_type_of(T value = T()) {
(void)value;
std::clog << __PRETTY_FUNCTION__ << std::endl;
}
int main()
{
float x = 3.14;
print_type_of(x);
print_type_of<std::string>();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment