[C++-sig] operator !=?

David Abrahams dave at boost-consulting.com
Mon Mar 31 22:45:00 CEST 2003


Nicodemus <nicodemus at globalite.com.br> writes:

> Giulio Eulisse wrote:
>
>>When trying to pystify any of the operator!= of any of the QT classes I
>>get the following error:
>>
>>boostQT.cc: In function `void init_module_boostQT ()':
>> boostQT.cc:1458: no matching function for call to
>> boost::python::class_<QVariant,
>> boost::python::detail::not_specified,
>> boost::python::detail::not_specified,
>> boost::python::detail::not_specified>::def (bool)'
>>boostQT.cc:1914: parse error before `.'
>> boostQT.cc:2914: no matching function for call to
>> boost::python::class_<QWidget, boost::noncopyable,
>> {unnamed}::QWidget_Wrapper,
>> boost::python::detail::not_specified>::def (const char[15], {unknown
>> type}, void ({unnamed}::QWidget_Wrapper::*) (int, int))'
>> /usr/include/g++-3/stl_relops.h: In function `bool operator!= (const
>> _Tp &, const _Tp &) [with _Tp = boost::python::self_ns::self_t]':
>>boostQT.cc:1458:   instantiated from here
>> /usr/include/g++-3/stl_relops.h:38: no match for
>> !boost::python::detail::operator_<op_eq,
>> boost::python::self_ns::self_t, boost::python::self_ns::self_t>'
>> /usr/include/g++-3/stl_relops.h:38: candidates are: operator!(bool)
>> <builtin>
>>
>>It happens, for example, with QVariant:
>>
>>class QVariant
>>{
>>[...]
>>bool operator==( const QVariant& ) const;
>>[...]
>> }; which gets converted to:
>>
>>
>>        .def( self != self )
>>
>>which looks correct to me...Any idea?
>>  
> I don't know, seems correct to me too. Dave?

Me too.  However I note that it's doing something in stl_relops, which
is mighty suspicious.  G++ is known to have overly liberal
argument-dependent lookup; maybe that's causing a problem here.

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





More information about the Cplusplus-sig mailing list