Re: using keyword problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Artur,

The "using" keyword is for bring identifiers from one namespace available in the current namespace.

For example:
using std::cout; // cout is now accessible, without the std:: qualifier.
using namespace std: // the whole std:: uberverse is accessible. Avoid collisions!


A class and a struct or sort of like namespaces, and also not like namespaces.

You want to do this...

class A
{
public:
    struct S
    {
        int x;
    };
};

int Method()
{
    typedef A::S S; // using A::S is no good here.

    S s;
    s.x = 1;
    return s.x;
};

HTH,
--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux