C++0x and Enumerated Subtypes

R

red floyd

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?
 
M

mlimber

red said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top