[C++-sig] Boost.Python << & >> bug

Niall Douglas s_sourceforge at nedprod.com
Sun Aug 3 17:45:10 CEST 2003


On 3 Aug 2003 at 15:14, c++-sig at python.org wrote:

Enclosed is the condensed example as requested. There are actually 
two bugs but I think the first (the original) is the same as the 
second - comment out the FXId one to see the second.

What's happening IMHO is that boost.python's wrappings of user types 
are failing to cast down to their containing types so therefore the 
compiler gets confused. Hence the error message from before.

The second bug is similar (MSVC7.1 report):

d:\Tornado\TClient\boost\boost\python\operators.hpp(190) : error 
C2678: binary '<<' : no operator found which takes a left-hand 
operand of type 'const FX::FXStream' (or there is no acceptable 
conversion)
        d:\Tornado\TClient\boost\boost\python\operators.hpp(190) : 
while compiling class-template member function 'PyObject 
*boost::python::detail::operator_l<op_lshift>::apply<L,R>::execute(con
st L &,const R &)'
        with
        [
            L=FX::FXStream,
            
R=boost::python::detail::unwrap_other<boost::python::other<unsigned 
char>>::type
        ]

Here because FXStream does not provide an overload for anything in 
boost, it can't know it's really an unsigned char.

Cheers,
Niall





More information about the Cplusplus-sig mailing list