TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: THOMAS MAEDER
from: JONATHAN DE BOYNE POLLARD
date: 1998-01-02 01:40:00
subject: What`s wrong with this?

 TM>>> explicit Vector(double xx = 0, double yy = 0);    //
 TM>>> constructor
 JB>> To kill any compiler warnings, should this not better be written as:
 JB>> explicit Vector(double xx = 0.0, double yy = 0.0);
 TM> Implicit conversion from int to double should not produce warnings.
There's nothing in the C++ Standard to say that it shouldn't (in fact, 
there's no concept of "warnings" in the C++ Standard at all), and portability 
enthusiasts would argue that a good quality implementation *should* produce 
warnings.  After all, it is not guaranteed that values of integral type can 
be converted to values of floating-point type without loss of precision and 
silent conversion to the next higher or lower floating-point value that can 
be represented.  
 ¯ JdeBP ®
--- FleetStreet 1.19 NR
---------------
* Origin: JdeBP's point, using Squish (2:440/4.3)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.