AW: [C++-sig] Re: Defining Policies for unknown data handles

Gottfried.Ganssauge at HAUFE.DE Gottfried.Ganssauge at HAUFE.DE
Mon Apr 7 23:48:26 CEST 2003


...
> Yes, I forgot about the specialization, sorry 8/. Thanks Gottfried!
> 
> 
> Here's the generated file:
> 
>     // Includes
>     
> ====================================================================
>     #include <boost/python.hpp>
>     #include <test.h>
> 
>     // Using
>     
> ==============================================================
> =========
>     using namespace boost::python;
> 
>     // Declarations
>     ================================================================
>     namespace  {
What's that namespace good for?
Presumably BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID defines a specialization
in namespace boost::python. With the above namespace in place that
specialization is defined within an anonymous namespace.

> 
> 
>     BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(opaque_)
> 
>     }// namespace
> 
> 
>     // Module
>     
> ======================================================================
>     BOOST_PYTHON_MODULE(test)
>     {
>         def("open_opaque", &open_opaque, return_value_policy<
>     return_opaque_pointer >());
>     } 
> 
> 
> But this is producing compiler errors in my machine (Windows 
> XP, Intel 
> 6.0, STLport-4.5.3):
> 
> 
>     test.cpp
>     test.cpp(13): error: "type_info" is ambiguous
>       BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(opaque_)
>       ^
> 
>     test.cpp(13): error: "type_id" is not a class or function template
>     name in the current scope
>       BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(opaque_)
>       ^
> 
>     test.cpp(13): error: expected a ";"
>       BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(opaque_)
> 
>     ... snip more 1452 lines of errors. 8P
> 
> 
> 
> I believe the code is correct, seems more like a problem with 
> my setup. 
> Any ideas?
Sorry, I don't have that compiler available, only could check the code with
gcc-3.2
I would try without that namespace.

Cheers,

Gottfried
> 
> Regards,
> Nicodemus.
> 
> 
> 
> _______________________________________________
> 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