[C++-sig] Question regarding objects of enums
gideon may
gideon at computer.org
Thu Aug 14 21:28:39 CEST 2003
Hi Dave,
I tried to compile my library with the current cvs version and
stumbled on a problem with enums. The following worked with
boost 1.30.0 but fails with the cvs version (using MSVC 7):
class MyClass {
public:
enum Direction {
UP, DOWN
};
};
enum Color {
RED, GREEN, BLUE
};
void make_object()
{
object o1 = object(RED); // Works
object o2 = object(MyClass::UP); // Fails
}
TIA,
Gideon
Here is the output of the build :
--------------------------------------------------
E:\boost-03-08-14-0400\boost\python\object_core.hpp(230) : error C2893:
Failed to specialize function template 'const T *boost::
python::api::object::to_ptr(const T &)'
With the following template arguments:
'boost::add_const<T>::type'
with
[
T=boost::detail::reference_unwrapper<false>::apply<MyClass::Direction>::type
]
object.cpp(26) : see reference to function template instantiation
'boost::python::api::object::object(const T &)' being
compiled
with
[
T=MyClass::Direction
]
E:\boost-03-08-14-0400\boost\python\object_core.hpp(230) : error C2143:
syntax error : missing ')' before 'const'
C:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xmemory(136) :
fatal error C1004: unexpected end of file found
"cl" /Zm800 -nologo -GX -c -DNDEBUG -DBOOST_PYTHON_DYNAMIC_LIB
/Ogity /O2 /Gs /Ob2 /GX /GR /MD /Op /Zc:wchar_t,forScope
-I"..\..\..\libs\python\test" -I"E:\boost-03-08-14-0400"
-I"C:\Python22\include" -I"C:\Program Files\Microsoft Visual Studio .
NET\VC7\include"
-Fo"..\..\..\libs\python\test\bin\object_ext.pyd\vc7\release\runtime-link-d
ynamic\object.obj" -Tp"object.cpp
"
--------------------------------------------------
More information about the Cplusplus-sig
mailing list