Skip to content

Instantly share code, notes, and snippets.

@shardator
Last active October 30, 2022 16:25
Show Gist options
  • Save shardator/7d66475a938f55f5cc3060091138a82a to your computer and use it in GitHub Desktop.
Save shardator/7d66475a938f55f5cc3060091138a82a to your computer and use it in GitHub Desktop.

Print type:

#include <cxxabi.h>
...
auto print_type = []<typename TT>(TT&&) { 
        int s; return abi::__cxa_demangle(typeid(TT).name(),0,0,&s); };

In variant:

std::visit(print_type, variant);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment