Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 09 Dec 2012
Offline Last Active Apr 13 2015 07:16 PM

#5013579 Possible namespace bug?

Posted by dkrusu on 22 December 2012 - 11:27 PM

I'm not sure if this is intentional or a bug. When writing in the script language namespaces seem to inherit everything from the global, but when registering it it doesn't:


Script code:

namespace test {

    void blah() {

        string s;





That works, but if I register a global function inside of a namespace like this

pEngine->RegisterGlobalFunction("bool foo(const string &in)", asFUNCTION(Foo), asCALL_CDECL);


I get the following error:

System function (1, 18) : ERR  : Identifier 'string' is not a data type
 (0, 0) : ERR  : Failed in call to function 'RegisterGlobalFunction' with 'bool isDir(const string &in)' (Code: -10)
VelScript: /home/droz/Projects/Velox/VelScript/Include/Script.h:235: void Vel::Script::FunctionGroup::Register(asIScriptEngine*): Assertion `Ret >= 0' failed.

If I register it with:

pEngine->RegisterGlobalFunction("bool foo(const ::string &in)", asFUNCTION(Foo), asCALL_CDECL);


it works.