[SciPy-dev] Re: [Scipy-cvs] world/scipy/weave/scxx object.h,1.8,1.9 sequence.h,1.3,1.4

Pearu Peterson pearu at cens.ioc.ee
Sat Oct 12 06:13:29 EDT 2002


On Fri, 11 Oct 2002 eric at localhost.localdomain wrote:

> Update of /home/cvsroot/world/scipy/weave/scxx
> In directory shaft:/tmp/cvs-serv27620
> 
> Modified Files:
> 	object.h sequence.h 
> Log Message:

> removed the not() operator from object.h.  For some reason, it was
> causing problems in gcc 3.2 -- is it reserved or something?  Anyway, I
> haven't used it and don't consider it to be critical at the moment, so
> I've just commented it out until there is more time to look it over.

not is C++ operator:

  bool operator not() const {
    return PyObject_Not(_obj) == 1;
  };

works in gcc 3.0 and 3.1 but not in gcc 2.95. The following works in all
versions of gcc:

#if defined(__GNUC__) && __GNUC__ < 3
  bool not() const {
#else
  bool operator not() const {
#endif
    return PyObject_Not(_obj) == 1;
  };

I don't know which one road works for other C++ compilers but my guess
would be the #else part provided that these compilers follow C++ standard
closely.

Pearu




More information about the SciPy-Dev mailing list