Created
December 11, 2023 22:26
-
-
Save KjellKod/79c4de803fd3149fec1277c00b9a90d9 to your computer and use it in GitHub Desktop.
c++ figure out weird template arguments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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