From: <ber...@t-...> - 2004-07-14 19:02:36
|
resending since I received an error message from the mail system -------- Original Message -------- Subject: Re: [Quantity-devel] temperature conversion Date: Mon, 12 Jul 2004 17:32:22 +0200 From: ber...@t-... (Bernd Speiser) Reply-To: ber...@un... To: ber...@un... CC: qua...@li..., qua...@li... References: <40E...@un...> <40E...@un...> <40F...@un...> Bernd Speiser wrote: As regards the "implicit conversion" problem, > CelsiusTemperature Tc2 (0.); > ThermodynamicTemperature Tt3 (298.15); > ThermodynamicTemperature Tt4a = Tt3 + Tc2; // prints 298.15 K (wrong) > ThermodynamicTemperature Tt4b = Tc2 + Tt3; // prints 571.3 K > CelsiusTemperature Tc4a = Tt3 + Tc2; // prints 25 oC > CelsiusTemperature Tc4b = Tc2 + Tt3; // prints 298.15 oC (wrong) this was related to a non-safe operator+=, which accepted ANY quantity as a right hand side operand. This has now been changed. The above addition statements do no longer compile, as one should expect. Explicit conversion between the temperatures is still possible. The new version has just been uploaded to cvs. Bernd -- ======================================================================= Bernd Speiser Institut f"ur Organische Chemie Auf der Morgenstelle 18 D-72076 T"ubingen Germany phone: +49-7071-2976205 (office) +49-7071-2976242 (laboratory) fax: +49-7071-295518 e-mail: ber...@un... Internet: http://www.uni-tuebingen.de/speiser ======================================================================= -- ======================================================================= Bernd Speiser Institut f"ur Organische Chemie Auf der Morgenstelle 18 D-72076 T"ubingen Germany phone: +49-7071-2976205 (office) +49-7071-2976242 (laboratory) fax: +49-7071-295518 e-mail: ber...@un... Internet: http://www.uni-tuebingen.de/speiser ======================================================================= |