This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: using keyword problem


The using-declaration is used to bring every declaration with a given
name into scope. Here when you say A::S, there is no namespace "A", it
is the name of the class.

Try the code below. 

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

int Method()
{
    A::S s;
    s.x = 1;
    return s.x;
};


Thanks,
L.Suresh


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]