]> www.ginac.de Git - ginac.git/commitdiff
Implicit conversion from cl_N to numeric considered harmful.
authorAlexei Sheplyakov <varg@theor.jinr.ru>
Wed, 19 Mar 2008 09:28:10 +0000 (12:28 +0300)
committerJens Vollinga <jensv@nikhef.nl>
Mon, 28 Jul 2008 19:22:49 +0000 (21:22 +0200)
Finally, mark the numeric(const cl_N&) ctor as explicit.
This allows one to mix the code using GiNaC and CLN, i.e.

cl_N x, y;
// initialize them
cl_N z = sin(x) +  y*exp(y);
symbol a("a");
ex e = exp(a);

ginac/numeric.h

index c0f9a8b6b9ace18f344d53377c13a2f749182fa7..bf5c70134cedcfafcad15a06d3c8f003a1777bca 100644 (file)
@@ -184,7 +184,7 @@ public:
        const numeric denom() const;
        int int_length() const;
        // converting routines for interfacing with CLN:
        const numeric denom() const;
        int int_length() const;
        // converting routines for interfacing with CLN:
-       numeric(const cln::cl_N &z);
+       explicit numeric(const cln::cl_N &z);
 
 protected:
        void print_numeric(const print_context & c, const char *par_open, const char *par_close, const char *imag_sym, const char *mul_sym, unsigned level) const;
 
 protected:
        void print_numeric(const print_context & c, const char *par_open, const char *par_close, const char *imag_sym, const char *mul_sym, unsigned level) const;