🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Fully qualified namespace when calling base class implementation

Started by
2 comments, last by iraxef 9 years, 7 months ago

namespace ns
{
    abstract class Base
    {
        void Setup() { print("Base::Setup()"); }
    }

    class Derived : ns::Base
    {
        void Setup()
        {
            ns::Base::Setup(); // "Namespace 'ns::Base' doesn't exist"
            print("Derived::Setup()");
        }
    }
}

Changing the line above to just Base::Setup() works.

Advertisement

Thanks. I'll have it fixed.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

I've fixed this in revision 2053

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Here's a possibly related scenario:


namespace ns
{
    namespace __ns
    {
        const string FOO = 'bar';
    }

    void DoStuff ( )
    {
        // this works
        print( ns::__ns::FOO );

        // compiler error: "Unknown scope '__ns'"
        print( __ns::FOO );
    }
}

This topic is closed to new replies.

Advertisement