Skip to content

Instantly share code, notes, and snippets.

@jingzhehu
Last active July 16, 2018 00:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jingzhehu/acaa8d2aacee85deb93289693202bc2d to your computer and use it in GitHub Desktop.
Save jingzhehu/acaa8d2aacee85deb93289693202bc2d to your computer and use it in GitHub Desktop.
Print type with boost:type_index #c++
#include <iostream>
#include <boost/type_index.hpp>
#define PRINT_TYPE(param) std::cout << boost::typeindex::type_id_with_cvr<decltype(param)>().pretty_name() << std::endl;
#define PRINT_TYPE_T(T) std::cout << "param type is: " << boost::typeindex::type_id_with_cvr<T>().pretty_name() << std::endl;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment