The company I work for has an API for mangling C++ symbols for a specific ABI.
I am trying to rewrite the API to make it more straightforward.
I have the following class template:
template <typename T> struct Symbolizer;
template <class Class_T, typename ReturnType_T>
struct Symbolizer<ReturnType_T (Class_T::*FuncPtr)()>
{
std::string operator() ()
{
// ...
}
};
template <class Class_T, typename ReturnType_T>
struct Symbolizer<ReturnType_T (Class_T::*FuncPtr)() const>
{
std::string operator() ()
{
// ...
}
};
So that one would mangle std::string::length this way:
Symbolizer<&std::string::length> symbolizer;
std::cout << symbolizer() << std::endl;
When I build it with g++, I get the following error:
error: ‘FuncPtr’ was not declared in this scope
G++ doesn't seem to understand I am declaring FuncPtr, and not using it.
Am I doing something wrong or is it just impossible to do it with c++?
One more info: I am stuck with c++ 98.