Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Member Since 09 Dec 2012
Offline Last Active Dec 14 2014 06:08 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.