Jump to content
  • Advertisement
Sign in to follow this  

Nested Namespaces

This topic is 1013 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have an issue where if I use nested namespace I can't access them with-in a method.

r = e->SetDefaultNamespace("dev::log");
r = e->RegisterGlobalFunction("void info(const ::string &in)",    asFUNCTION(util::log_info),    asCALL_CDECL); assert(r >= 0);
r = e->RegisterGlobalFunction("void warning(const ::string &in)", asFUNCTION(util::log_warning), asCALL_CDECL); assert(r >= 0);
r = e->RegisterGlobalFunction("void error(const ::string &in)",   asFUNCTION(util::log_error),   asCALL_CDECL); assert(r >= 0);

If I run this function this works.

void main()
{
  dev::log::info("doop");
  dev::log::warning("doop");
  dev::log::error("doop");
}

But if I instance and run huh().

class Test
{
  void huh()
  {
    dev::log::info("Hi");
  } 
}

I get the error

ERR  : Namespace 'dev' doesn't exist.

Error doesn't happen with one level of namespaces, ie. just 'log'

Have I done something incorrect?

 

Share this post


Link to post
Share on other sites
Advertisement

I've fixed this bug in revision 2207.

 

If you do not wish to upgrade to the latest WIP I believe you can work around the problem by adding 'r = e->SetDefaultNamespace("dev");' to explicitly register the 'dev' namespace too.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!