Skip to content

Instantly share code, notes, and snippets.

@KjellKod
Created December 11, 2023 22:26
Show Gist options
  • Save KjellKod/79c4de803fd3149fec1277c00b9a90d9 to your computer and use it in GitHub Desktop.
Save KjellKod/79c4de803fd3149fec1277c00b9a90d9 to your computer and use it in GitHub Desktop.
c++ figure out weird template arguments
#include <cxxabi.h>
#include <typeinfo>
void main(){
int status;
char * producerType = abi::__cxa_demangle(typeid(someType).name(),0,0,&status);
char * consumerType = abi::__cxa_demangle(typeid(someType).name(),0,0,&status);
std::cout << "Producer type: " << producerType << "\n";
std::cout << "Consumer type: " << consumerType << "\n";
free(producerType);
free(consumerType);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment