[C++-sig] Re: Question regarding objects of enums
Nikolay Mladenov
nickm at sitius.com
Tue Aug 19 06:32:09 CEST 2003
Dave
Unfortunately I don't understand the solution to the problem,
but I need something similar to be done
in the value_holder.hpp( probably the BOOST_PYTHON_UNFORWARD_LOCAL
macro)
since I am getting:
D:\Shared\boost_1_31_0\boost\boost/python/object/forward.hpp(175) :
error C2893: Failed to specialize function template 'const T &__cdecl
boost::python::objects::do_unforward(const T &,...)'
With the following template arguments:
'enum View::Display::Option'
D:\Shared\boost_1_31_0\boost\boost/python/object/make_holder.hpp(82) :
see reference to function template instantiation '__thiscall
boost::python::objects::value_holder<struct
View::Display>::boost::python::objects::value_holder<struct
View::Display>(struct _object *,enum View::Display::Option)' being
compiled
D:\Shared\boost_1_31_0\boost\boost/python/object/forward.hpp(175) :
error C2784: 'T &__cdecl boost::python::objects::do_unforward(const
class boost::reference_wrapper<T> &,int)' : could not deduce template
argument for 'const class boost::reference_wrapper<T> &' from 'enum
View::Display::Option'
David Abrahams wrote:
>
> gideon may ?gideon at computer.org? writes:
>
> ? 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
>
> VC7 bug. Fixed in CVS with enclosed patch.
>
> ------------------------------------------------------------------------
>
> object_core.patchName: object_core.patch
> Type: text/x-patch
>
> ------------------------------------------------------------------------
>
> --
> Dave Abrahams
> Boost Consulting
> www.boost-consulting.com
>
> ------------------------------------------------------------------------
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig
More information about the Cplusplus-sig
mailing list