[C++-sig] V2: another run time error

David Abrahams david.abrahams at rcn.com
Fri Apr 12 23:50:24 CEST 2002


----- Original Message -----
From: "Peter Bienstman" <Peter.Bienstman at rug.ac.be>


> On Fri, 12 Apr 2002, David Abrahams wrote:
>
> > Peter,
> >
> > The crash is a bug in the intel compiler's EH implementation. It
should
> > report an error (with, at this stage, a cryptic error message --
> > TypeError: bad argument type for built-in operation). The problem is
> > that you're requesting that the result of an rvalue conversion
(Python
> > complex -> C++ complex) be bound to a non-const reference. If you
change
> > your intialization to:
> >
> >   m
> >     .add(class_<M>("M")
> >          .def_init(args<std::complex<double> const&>()))
-------------------------------------------------^^^^^
> >     ;
> >
> > the code will work.
>
> I'm sorry to disappoint you, but it doesn't work. I even tried
changing
> type_list to args, but no effect...

Maybe there are other bugs in the intel6 compiler for Linux, then...
Since I haven't installed it yet, I can't say for sure.

> BTW: the same code worked perfectly with gcc3 (unless there have been
some
> drastic changes in bpl in the last 2 days)

Your code as written didn't work for me with any compiler, including
gcc-3.0.3. Adding the const pointed out above was absolutely required
for me, as I would expect. It would really surprise me if it worked for
you without the const.

-Dave






More information about the Cplusplus-sig mailing list