473,471 Members | 4,648 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

using...

can i do this:

class B {
protected:
enum E { X };
};

class D : public B {
public:
using B::E;
};

to import the enum's into the public scope of D??? gcc tells me i can't when
i try to use it later like this: D::X;

martin
Oct 12 '05 #1
4 1112
Martin Vorbrodt wrote:
can i do this:

class B {
protected:
enum E { X };
};

class D : public B {
public:
using B::E;
};

to import the enum's into the public scope of D??? gcc tells me i can't when
i try to use it later like this: D::X;


You've declared 'B::E', not 'B::X'. Why do you expect 'D::X' to be
public all of a sudden?

V
Oct 12 '05 #2
"Victor Bazarov" <v.********@comAcast.net> wrote in message
news:HV*******************@newsread1.mlpsca01.us.t o.verio.net...
Martin Vorbrodt wrote:
can i do this:

class B {
protected:
enum E { X };
};

class D : public B {
public:
using B::E;
};

to import the enum's into the public scope of D??? gcc tells me i can't when i try to use it later like this: D::X;


You've declared 'B::E', not 'B::X'. Why do you expect 'D::X' to be
public all of a sudden?

V


How could I import both E and X then?
Oct 12 '05 #3
Martin Vorbrodt wrote:
"Victor Bazarov" <v.********@comAcast.net> wrote in message
news:HV*******************@newsread1.mlpsca01.us.t o.verio.net...
Martin Vorbrodt wrote:
can i do this:

class B {
protected:
enum E { X };
};

class D : public B {
public:
using B::E;
};

to import the enum's into the public scope of D??? gcc tells me i can't
when
i try to use it later like this: D::X;


You've declared 'B::E', not 'B::X'. Why do you expect 'D::X' to be
public all of a sudden?

V

How could I import both E and X then?


Huh? Two 'using' statements, maybe... Just a thought...

V
Oct 12 '05 #4

Martin Vorbrodt wrote:
can i do this:

class B {
protected:
enum E { X };
};

class D : public B {
public:
using B::E;
};

to import the enum's into the public scope of D??? gcc tells me i can't when
i try to use it later like this: D::X;

martin


What's the point of declaring an enum E protected in the first place?
It's not a method, it's not member data, it's just an enumerated type.

Greg

Oct 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Enos Meroka | last post by:
Hallo, I am a student doing my project in the university.. I have been trying to compile the program using HP -UX aCC compiler, however I keep on getting the following errors. ...
3
by: Mike L | last post by:
Should the command call "using" be before or after my namespace? **AFTER** namespace DataGridBrowser { using System; using System.Drawing; using System.Drawing.Drawing2D; using...
3
by: xzzy | last post by:
I was wondering why we have to have using System.Data using System.Configuration using etc.... why are they not all lumped into one 'using'? In other words, is there a best way to use...
14
by: pmud | last post by:
Hi, I need to use an Excel Sheet in ASP.NET application so that the users can enter (copy, paste ) large number of rows in this Excel Sheet. Also, Whatever the USER ENETRS needs to go to the...
8
by: acb | last post by:
Hi, I wrote a DLL Component (using Visual Studio 2005) and managed to include it into a C# Console application. I am now trying to include this component into a Web project. I copy the DLL...
0
by: Metal2You | last post by:
I'm working on an ASP.NET 2.0 application in Visual Studio 2005 that accesses a Sybase database back end. We're using Sybase SQL Anywhere 9.0.2.3228. I have installed and registered the Sybase...
10
by: mg | last post by:
I'm migrating from VB6 and have a question about using 'Using' and the best way to use it. Here is a example of a small bit of code: dbConx("open") Using CN Dim CMD As New OleDbCommand(sSQL,...
0
by: Eugene Anthony | last post by:
The problem with my coding is that despite removing the records stored in the array list, the rptPages repeater control is still visible. The rptPages repeater control displayes the navigation...
3
by: JDeats | last post by:
I have some .NET 1.1 code that utilizes this technique for encrypting and decrypting a file. http://support.microsoft.com/kb/307010 In .NET 2.0 this approach is not fully supported (a .NET 2.0...
6
by: =?Utf-8?B?U2hhd24gU2VzbmE=?= | last post by:
Greetings! I was researching AJAX to provide a solution to displaying status messages while a long process executed. I found several examples online and was able to use their code to get a quick...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.