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)
|