   [Solved]How to avoid namespace problems when registering
  Again me, but I am currently in the step of integrating what I developed so far and one thing I amstuck with and I am unsure how to solve it is namespaces in function signatures of functions which are regsieterd in the scripting interface.A concrete example. I have the following class method:virtual std::string getUID();Because I don't use "using namespace" in header files, I prepended the std:: namespace to the string. My initial registerClassMethod call looked like:engine.registerClassMember("GameObject","string getUID()",asMETHOD(GameObject,getUID),asCALL_THISCALL);However I got the error that the declaration is invalid, which I could understand because the signature of the method differs between the headerfile and the declaration in the registering call. So I changed it toengine.registerClassMember("GameObject","std::string getUID()",asMETHOD(GameObject,getUID),asCALL_THISCALL);This however no gives me an error when parsing the declaration by angelscript with a "System error (1,4): ERR: Expected identifier".So my question is, what is the proper way to deal with such namespace issues or am I completely on the wrong track?Thoran[Edited by - Thoran on April 19, 2010 2:35:39 PM]
  Try this instead:engine.registerClassMember("GameObject", "string getUID()", asMETHODPR(GameObject, getUID, (), std::string), asCALL_THISCALL);This will let you specify the exact signature of the method you wish to register. ;  That didn't help, but with some debugging I found the problem for the asINVALID_DECLARATION. Inengine.registerClassMethod("GameObject","string getUID()",asMETHOD("GameObject",getUID));I return the string by value, tough it is a reference type (according to scriptstring.cpp). So the solution is to always use "string&" when dealing with the scriptstring data type, to avoid asINVALID_DECLARATION.Correct register call:engine.registerClassMethod("GameObject","string& getUID()",asMETHOD("GameObject",getUID));Thansk for your help,Thoran   