[PPL-devel] Re: Even more questionable feature of the C++ interface (GMP 4.0.1)

Roberto Bagnara bagnara at cs.unipr.it
Fri Apr 5 16:43:04 CEST 2002


Ballabio Gerardo - Dip. di Scienza dei Materiali wrote:
> I didn't know about automatic conversion from pointers to bool type. I
> guess it's for fast testing whether a pointer is null.
> In view of that, I agree now that construction and assignment from
> bool must be removed. They're just too dangerous.
> 
> Instead, I'm not convinced that assignment from mpz_srcptr should be
> provided. If so, then one could expect other operators as well -- for
> example, mpz_class + mpz_t, and so on.
> 
> ...
> 
> In attachment there's a version of gmpxx.h where I removed all
> constructors and assignments from bool -- but I didn't add their mpz_t
> counterparts.
> In passing, I've also removed mpf_class::set_str2() (I think now that
> mpf_class::set_str() is good enough), and thus the need to #include
> the huge <iostream> (<iosfwd> is enough) and <strstream>.

Hi Gerardo,

all in all, I agree with you.  By the way, I have checked that your revised
gmpxx.hh is not causing regressions with our C++ code.
Thanks a lot

       Roberto

-- 
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:bagnara at cs.unipr.it




More information about the PPL-devel mailing list