Hey all,
I've been writing a nice & simple scripting system, and so far have been doing pretty well, except for the multitude of complilation errors (just simple mistakes )..
My main issue is that I'm using std::map as a table of commands, with a key, and a function pointer to process the command.
The problem comes with using insert() to add a new element, in particular, the make_pair function.
Here's the code:
Code:
void Machine::Command(std::string key, bool *FuncReference(std::string, Stack))
{
_commands.insert( make_pair(key, FuncReference));
}
And the error:
Code:
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\c++\3.4.5\bits\stl_pair.h:74: error: field `std::pair<const std::string, bool*()(std::string, Stack)>::second' invalidly declared function type
I'm really quite stuck with this. Maybe because I haven't slept in 4 days, but hey...
I'll keep screwing around with this thing, right after I get some sleeeep.. Help is still appreciated though.
Cheers