http://d.puremagic.com/issues/show_bug.cgi?id=259
--- Comment #38 from [email protected] 2013-04-07 19:29:00 PDT --- (In reply to comment #35) > 3. Otherwise, the comparison is in error. The error message may recommend > using > the std.traits.unsigned function, which executes a size-informed cast. This is the source of unsigned: auto unsigned(T)(T x) if (isIntegral!T) { static if (is(Unqual!T == byte )) return cast(ubyte ) x; else static if (is(Unqual!T == short)) return cast(ushort) x; else static if (is(Unqual!T == int )) return cast(uint ) x; else static if (is(Unqual!T == long )) return cast(ulong ) x; else { static assert(T.min == 0, "Bug in either unsigned or isIntegral"); return cast(Unqual!T) x; } } Is it better to use template constraints there? And isn't it better for unsigned to accept only unsigned Ts? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
