[Issue 4417] uniform() doesn't check constness of RNG

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Feb 16 02:18:47 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=4417


Peter Alexander <peter.alexander.au at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |peter.alexander.au at gmail.co
                   |                            |m
         Resolution|                            |FIXED


--- Comment #3 from Peter Alexander <peter.alexander.au at gmail.com> 2014-02-16 02:18:42 PST ---
Fixed, the error is now:

bug.d(5): Error: template std.random.uniform cannot deduce function from
argument types !()(int, int, const(LinearCongruentialEngine!(uint, 48271, 0,
2147483647))), candidates are:
std/random.d(1201):        std.random.uniform(string boundaries = "[)", T1,
T2)(T1 a, T2 b) if (!is(CommonType!(T1, T2) == void))
std/random.d(1238):        std.random.uniform(string boundaries = "[)", T1, T2,
UniformRandomNumberGenerator)(T1 a, T2 b, ref UniformRandomNumberGenerator
urng) if (isFloatingPoint!(CommonType!(T1, T2)) &&
isUniformRNG!UniformRandomNumberGenerator)
std/random.d(1333):        std.random.uniform(string boundaries = "[)", T1, T2,
RandomGen)(T1 a, T2 b, ref RandomGen rng) if ((isIntegral!(CommonType!(T1, T2))
|| isSomeChar!(CommonType!(T1, T2))) && isUniformRNG!RandomGen)
std/random.d(1484):        std.random.uniform(T,
UniformRandomNumberGenerator)(ref UniformRandomNumberGenerator urng) if (!is(T
== enum) && (isIntegral!T || isSomeChar!T) &&
isUniformRNG!UniformRandomNumberGenerator)
std/random.d(1504):        std.random.uniform(T)() if (!is(T == enum) &&
(isIntegral!T || isSomeChar!T))
bug.d(69):        ... (2 more, -v to show) ...

It's still a bit cluttered, but that's a general problem of D template errors,
no longer specific to uniform.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list