[C++-sig] Re: Question regarding objects of enums

David Abrahams dave at boost-consulting.com
Tue Aug 19 14:35:46 CEST 2003


Nikolay Mladenov <nickm at sitius.com> writes:

> Try this with MSVC (6.5):
>
> ///////////////////////////
> class OBJ{
> public :
>     enum PROP{ p };
>     OBJ(PROP p){}
> };
>
> #include <boost/python.hpp>
>
> using namespace boost::python;
>
> BOOST_PYTHON_MODULE(obj)
> {
>     scope s(
>         class_<OBJ>("OBJ", init<OBJ::PROP>() )
>         );
>     enum_<OBJ::PROP> ("PROP");
>     
> }
> ////////////////////////////////

Try this patch.  FYI, I'm not sure how many of these I can actually
work around, or how much energy I'm willing to put into it.  VC7 and
VC6 especially seem to be really broken when it comes to instantiating
templates on enums nested in classes.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: forward.patch
Type: text/x-patch
Size: 886 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20030819/035c8bf2/attachment.bin>
-------------- next part --------------

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com


More information about the Cplusplus-sig mailing list