test codes:
#include <iostream>
using namespace std;
struct qq
{
int x;
int y;
};
typedef qq (*ptr)(int a, int b);
ptr pp;
pp(3,3). --------not work.
int main()
{
cout << "Hello world!" << endl;
return 0;
}
Edit:
relative with these codes:
if (token.GetChar(0) == '(')
{
// function pointer (probably)
is_function_pointer = true;
if (peek.GetChar(0) == '(')
{
// typedef void (*dMessageFunction)(int errnum, const char *msg, va_list ap);
// typedef void (MyClass::*Function)(int);
// remove parentheses and keep everything after the dereferencing symbol
token.RemoveLast();
int pos = token.Find('*', true);
if (pos != wxNOT_FOUND)
{
typ << _T('(') << token.Mid(1, pos) << _T(')');
token.Remove(0, pos + 1);
}
else
{
typ = _T("(*)");
token.Remove(0, 1); // remove opening parenthesis
}
args = peek;
components.push(token);
}
else
{
// typedef void dMessageFunction (int errnum, const char *msg, va_list ap);
typ = _T("(*)");
// last component is already the name and this is the args
args = token;
}
break;
}