[C++-sig] Difference between old and new Boost.Python interface.

Alex Mohr amohr at pixar.com
Wed Sep 27 22:26:02 CEST 2006


> I think you are right. I tried to fix it, but run into problem.
> It seems that Boost.Python does not contains helper class that extracts
> "wrapped" class. ( I can not find it ). So I wrote next code that does not
> compiles:
> 
> typedef
> 
> boost::type_traits::remove_pointer<
> 
>     boost::type_traits::function_traits<
> 
>         &detail::unwrap_wrapper<ClassT::wrapped_type>
> 
>      >::result_type
> 
>> ::type unwrapped_type;
> 
> expected initializer before '<' token. I think that the problem with the way I
> pass pointer to unwrap_wrapper function. Also I could be wrong. Do you have
> an idea how I should fix the code or may be you can propose another way
> to fix the problem?
> 
> Thanks

Try using the unwrapped type when you def the operators -- for instance, 
use:

.def(T() + T())

instead of

.def(self + self)

I think there's a way to avoid the construction too.. but the boost.org 
page is sluggish right now so I can't look it up easily.

Alex



More information about the Cplusplus-sig mailing list