This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: using keyword problem
- From: "L.Suresh" <suresh at comodogroup dot com>
- To: gcc-help at gcc dot gnu dot org
- Cc: artur at alice dot phy dot uct dot ac dot za
- Date: Fri, 27 Aug 2004 17:41:08 +0530
- Subject: RE: using keyword problem
- Organization: Comodo
- Reply-to: suresh at comodogroup dot com
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