Discussion:
Strongly typed enumerations in Visual C++
(too old to reply)
Mateusz Loskot
2009-08-21 17:18:46 UTC
Permalink
Hi,

Does anyone know if there is any plan to implement C++0X feature
of strongly typed enumerations, so called "scoped enum" ?

I know Boost provides emulation [1] of scoped enum, but I'm looking
for a native support of that in Visual C++.

I couldn't find any information, but perhaps there is some rumors.
Perhaps in Visual Studio 2010?

[1]
https://svn.boost.org/trac/boost/browser/trunk/boost/detail/scoped_enum_emulation.hpp

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org
Victor Bazarov
2009-08-21 18:01:54 UTC
Permalink
Post by Mateusz Loskot
Does anyone know if there is any plan to implement C++0X feature
of strongly typed enumerations, so called "scoped enum" ?
No plan, at least according to
http://msdn.microsoft.com/en-us/library/dd465215(VS.100).aspx , but
there is "enum class" in C++/CLI (managed enum). Maybe that could help?
Post by Mateusz Loskot
I know Boost provides emulation [1] of scoped enum, but I'm looking
for a native support of that in Visual C++.
I don't think they are planning on adding it.
Post by Mateusz Loskot
I couldn't find any information, but perhaps there is some rumors.
Perhaps in Visual Studio 2010?
[1]
https://svn.boost.org/trac/boost/browser/trunk/boost/detail/scoped_enum_emulation.hpp
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Mateusz Loskot
2009-08-22 12:05:04 UTC
Permalink
Post by Victor Bazarov
Post by Mateusz Loskot
Does anyone know if there is any plan to implement C++0X feature
of strongly typed enumerations, so called "scoped enum" ?
No plan, at least according to
http://msdn.microsoft.com/en-us/library/dd465215(VS.100).aspx ,
Thanks for the reference. That's a pity.
Post by Victor Bazarov
but there is "enum class" in C++/CLI (managed enum). Maybe that could help?
Yes, I know this feature, however I'm not sure how would that
help in pure C++ project without use of managed elements.

Do you mean something like this?

#if _MANAGED
#define MY_ENUM public enum class
#else
#define MY_ENUM enum
#endif

MY_ENUM Channel { Red, Green, Blue };
Post by Victor Bazarov
Post by Mateusz Loskot
I know Boost provides emulation [1] of scoped enum, but I'm looking
for a native support of that in Visual C++.
I don't think they are planning on adding it.
I have that impression, as there has been no "noise" about that around.


Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org
Loading...