[GiNaC-devel] [PATCH 7/8] Implicit conversion from cl_N to numeric considered harmful.

Alexei Sheplyakov varg at theor.jinr.ru
Wed Mar 19 10:28:10 CET 2008


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 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ginac/numeric.h b/ginac/numeric.h
index f52ffc0..7363c9e 100644
--- a/ginac/numeric.h
+++ b/ginac/numeric.h
@@ -184,7 +184,7 @@ public:
 	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;
-- 
1.5.4.2


-- 
All science is either physics or stamp collecting.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: Digital signature
Url : http://www.cebix.net/pipermail/ginac-devel/attachments/20080319/fc2e0940/attachment.sig 


More information about the GiNaC-devel mailing list