[C++-sig] Re: creating an instance of a class_<> object in c+ + an d exporting it to python

dique chezdique at yahoo.com
Tue Aug 17 04:39:03 CEST 2004


Ah... it never comes to my mind that I can define it elsewhere. Perhaps I was illuded by the fact
that several get_pointer functions were all defined in namespace boost.
Anyway VC7 still chokes if I put it in the global namespace.
The good news is that I have upgraded to VC++ Toolkit 2003 recently...

--- David Abrahams <dave at boost-consulting.com> wrote:

> dique <chezdique at yahoo.com> writes:
> 
> > namespace boost
> > {
> >     // Some internal boost functions require get_pointer to be
> > defined.
> 
> But not in namespace boost.  Never, ever make a definition in a
> library's namespace unless the documentation tells you to.
> Put this in the same namespace as ObjectWrap, or if your compiler is
> broken like vc6/7, put it in the global namespace.
> 
> >     // Define this before including <boost/python.hpp>
> >     template<class T>
> >     inline T * get_pointer(ObjectWrap<T> const & p)
> >     {
> >         return p.get();
> >     }
> > }
> 
> -- 
> Dave Abrahams
> Boost Consulting
> http://www.boost-consulting.com
> 
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig
> 



	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 



More information about the Cplusplus-sig mailing list