I have an enum in a namespace like,
namespace client{
namespace ui{
enum InkEnum{
ID_INK_COLOR,
ID_INK_WIDTH,
};
class InkEventHandler{
...
};
}
}
Now I want this enum in a different namespace,
#include "../client/ui/InkEventHandler.hpp"
using client::ui::InkEventHandler;
namespace ui{
class InkMenu : public ...{
/// I need the ID_INK_COLOR etc here inside the member function.
};
}
however using client::ui::InkEnum is not giving the desigred result.
ofcourse using namespace client::ui; is working, However it opens all
other definitions also, which I may not want.
Moreover I will use InkEnum with InkEventHandler only. Thus can I have
the enum inside the InkEventHandler class definition, so that whenever
I use the class ID_INK_COLOR etc are available?
thanks
abir 3 2516
toton wrote:
I have an enum in a namespace like,
namespace client{
namespace ui{
enum InkEnum{
ID_INK_COLOR,
ID_INK_WIDTH,
};
class InkEventHandler{
...
};
}
}
Now I want this enum in a different namespace,
Just fully qualify it:
client::ui::InkEnum inkNum;
--
Ian Collins.
Ian Collins wrote:
toton wrote:
I have an enum in a namespace like,
namespace client{
namespace ui{
enum InkEnum{
ID_INK_COLOR,
ID_INK_WIDTH,
};
class InkEventHandler{
...
};
}
}
Now I want this enum in a different namespace,
Just fully qualify it:
client::ui::InkEnum inkNum;
Where to write this line? inside namespace client::ui ? or in the
InkMenu class definition file? All the enum variables are static
const? What the statement client::ui::InkEnum inkNum; means? They are
synonymous (reference) or copy ?
--
Ian Collins.
toton wrote:
Ian Collins wrote:
>>toton wrote:
>>>I have an enum in a namespace like, namespace client{ namespace ui{ enum InkEnum{ ID_INK_COLOR, ID_INK_WIDTH, }; class InkEventHandler{ ... }; } } Now I want this enum in a different namespace,
Just fully qualify it:
client::ui::InkEnum inkNum;
Where to write this line? inside namespace client::ui ? or in the
InkMenu class definition file? All the enum variables are static
const? What the statement client::ui::InkEnum inkNum; means? They are
synonymous (reference) or copy ?
Use it anywhere you want a variable of type client::ui::InkEnum, from
your original post, that would be as a member of InkMenu
Provided the appropriate header is included, you can use a fully
qualified name anywhere, just like you do whenever you use anything form
the standard library.
--
Ian Collins. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Marshall Mills |
last post by:
As I understand it, loaded statement, a using declaration should be all I
need to see an enum from within a namespace. The below code works fine with
class, struct, and union. What gives? As the...
|
by: Bilgehan.Balban |
last post by:
Hi,
I have two different enum definitions with members of same name. The
compiler complains about duplicate definitions. Is this expected
behaviour?
Can't I have same-named fields in...
|
by: msnews.microsoft.com |
last post by:
How do I get Intellisense to open a dropdown list box for a method's
parameters when the parameter is an ENUM?
public class MyClass
{
public enum IDkind
{
PersonID,
EntityID,
PlaceID
|
by: Joe |
last post by:
I have a .cs file which is linked to several other projects. All my classes
in this file are defined as internal. I would like to have an enum defined
as well in the namespace but I get an error...
|
by: Andrea Williams |
last post by:
I'm working with C# and I'm setting up some ENUM's I have a data and
Business layer. I'm declaring a common enum for the Data Layer. The UI
layer references the Bus layer and the bus layer...
|
by: toton |
last post by:
Hi,
I have some enum (enumeration ) defined in some namespace, not inside
class. How to use the enum constant's in some other namespace without
using the whole namespace.
To say in little...
|
by: Steven Nagy |
last post by:
So I was needing some extra power from my enums and implemented the
typesafe enum pattern.
And it got me to thinking... why should I EVER use standard enums?
There's now a nice little code...
|
by: Cmtk Software |
last post by:
I'm trying to define an enum which will be used from unmanaged c++, C++/CLI
managed c++ and from C#.
I defined the following enum in a VS dll project set to be compiled with the
/clr switch:
...
|
by: hufaunder |
last post by:
Imagine you have a charting library that can draw lines, bars,
floating bars, bands, etc.
Lines and bars need only one input. Floating bars and bands need two
inputs. There are two approaches:
...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
| |