www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - partial order defined for build-in types?

reply order d.com writes:
byte < short < int < real < double? 


function std.math2.abs called with argument types:
(short)
matches both:
std.math2.abs(int)
and:
std.math2.abs(real)
Jul 16 2005
parent "Walter" <newshound digitalmars.com> writes:
<order d.com> wrote in message news:dbcquo$2stq$1 digitaldaemon.com...
 byte < short < int < real < double?


 function std.math2.abs called with argument types:
 (short)
 matches both:
 std.math2.abs(int)
 and:
 std.math2.abs(real)

The partial ordering follows the same 3 level rule as function overloading: 1) exact match 2) match with implicit conversions 3) no match There aren't an arbitrarilly large number of levels like C++ has.
Jul 21 2005