Bug 19837 – std.random.isUniformRNG(Rng, ElementType) should not require Rng.front to be annotated `@property`
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-04-29T13:01:30Z
Last change time
2019-05-09T15:12:52Z
Keywords
pull
Assigned to
No Owner
Creator
Nathan S.
Comments
Comment #0 by n8sh.secondary — 2019-04-29T13:01:30Z
Example:
---
void main()
{
import std.random : isUniformRNG;
static struct RND1
{
ulong state;
@property uint front() const { return cast(uint) (state >> 32); }
void popFront() { state = state * 6364136223846793005 + 1442695040888963407; }
enum empty = false;
enum isUniformRandom = true;
}
static struct RND2 // Same but `front` is not @property
{
ulong state;
uint front() const { return cast(uint) (state >> 32); }
void popFront() { state = state * 6364136223846793005 + 1442695040888963407; }
enum empty = false;
enum isUniformRandom = true;
}
static assert(isUniformRNG!RND1);
static assert(isUniformRNG!(RND1, uint));
static assert(isUniformRNG!RND2);
static assert(isUniformRNG!(RND2, uint)); // Fails because RND2.front is not `@property`.
}
---
Comment #1 by dlang-bot — 2019-04-29T13:23:57Z
@n8sh created dlang/phobos pull request #6987 "Fix Issue 19837 - std.random.isUniformRNG(Rng, ElementType) should not require Rng.front to be annotated `@property`" fixing this issue:
- Fix Issue 19837 - std.random.isUniformRNG(Rng, ElementType) should not require Rng.front to be annotated `@property`
https://github.com/dlang/phobos/pull/6987
Comment #2 by dlang-bot — 2019-05-09T15:12:52Z
dlang/phobos pull request #6987 "Fix Issue 19837 - std.random.isUniformRNG(Rng, ElementType) should not require Rng.front to be annotated `@property`" was merged into stable:
- b7389926ee1ba7272d675cc08dd3ca7c46c39cf4 by Nathan Sashihara:
Fix Issue 19837 - std.random.isUniformRNG(Rng, ElementType) should not require Rng.front to be annotated `@property`
https://github.com/dlang/phobos/pull/6987