Does anyone know if C++0x will address the issue of enumerated subtypes?
That is, if I have an enum, and want a type-compatible subtype of it....
Something along the lines of
enum Day {
Sunday,
Monday,
Tuesday,
Wednesday,
Thursday,
Friday,
Saturday
};
and I want to create a subtype that's just the weekdays (Monday through
Friday). However, I don't want to have to do casting between the two.
This is equivalent to the Ada subtype construct.
Will C++0x support something like this? 1 2082
red floyd wrote:
Does anyone know if C++0x will address the issue of enumerated subtypes?
That is, if I have an enum, and want a type-compatible subtype of it....
Something along the lines of
enum Day {
Sunday,
Monday,
Tuesday,
Wednesday,
Thursday,
Friday,
Saturday
};
and I want to create a subtype that's just the weekdays (Monday through
Friday). However, I don't want to have to do casting between the two.
This is equivalent to the Ada subtype construct.
Will C++0x support something like this?
You might want to ask on comp.std.c++ instead.
Cheers! --M This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Ioannis Vranos |
last post by:
I would like to see your views on these.
C++98 is already a large language since it supports 4 paradigms and each one
is supported well, with optimal space and time efficiency. And this is...
|
by: Mike Krous |
last post by:
Hello All, I am having some problems modeling a relationship properly and
could use some advice. My final question is at the bottom of this post
(everything else is explanation). Basically what I...
|
by: Ben Finney |
last post by:
Howdy all,
I've recently packaged 'enum' in PyPI. In its description, I make the
claim that it creates "immutable" enumeration objects, and that the
enumeration values are "constant" values.
...
|
by: Crutcher |
last post by:
I've been playing with dictionary subtypes for custom environments,
and I encountered a strange interaction between exec, dictionary
subtypes, and global variables. I've attached a test program,...
|
by: Shawnk |
last post by:
This post is intended to verify that true value semantics DO NOT EXIST for the
Enum class (relative to boolean operations).
If this is true then (thus and therefore) you can not design state...
|
by: John Goche |
last post by:
Hello,
The following program compiler and runs fine under gcc and produces
the output 3. However, I am not sure whether such behavior is legal.
In particular, as a related question, how would I...
|
by: senfo |
last post by:
I'm using an enumerated type to identify a record type that relates to a
unique ID in a database. Identity columns in SQL start at 1, while
enumerated types in C# start at 0. I didn't think it...
|
by: rcdailey |
last post by:
Will there be a feature in C++0x to facilitate getting the number of
items in an enumeration? For example, in C++03, you have to do
something like this:
enum Foo
{
FOO1 = 0,
FOO2,
FOO3,...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
| |