From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2237 invoked by alias); 27 Aug 2004 12:11:37 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 2225 invoked from network); 27 Aug 2004 12:11:36 -0000 Received: from unknown (HELO kylie.comodo.net) (62.3.237.187) by sourceware.org with SMTP; 27 Aug 2004 12:11:36 -0000 Received: (qmail 32502 invoked by uid 1114); 27 Aug 2004 13:11:36 +0100 Received: from [192.168.200.21] (HELO [192.168.200.21]) (192.168.200.21) by kylie.comodo.net (qpsmtpd/0.28) with ESMTP; Fri, 27 Aug 2004 13:11:35 +0100 Subject: RE: using keyword problem From: "L.Suresh" Reply-To: suresh@comodogroup.com To: gcc-help@gcc.gnu.org Cc: artur@alice.phy.uct.ac.za Content-Type: text/plain Organization: Comodo Message-Id: <1093608668.5336.103.camel@Ironwing> Mime-Version: 1.0 Date: Fri, 27 Aug 2004 12:27:00 -0000 Content-Transfer-Encoding: 7bit X-Comodo-ClamAV-Virus-Check-By: kylie.comodo.net - FAILED! X-Comodo-ClamAV-Virus-Version: clamscan / ClamAV version 0.75 X-Comodo-F-Prot-Virus-Check-By: kylie.comodo.net X-Comodo-F-Prot-Virus-Program: F-PROT ANTIVIRUS Program version: 4.4.4 Engine version: 3.14.11 X-SW-Source: 2004-08/txt/msg00254.txt.bz2 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