mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
16 lines
511 B
D
16 lines
511 B
D
// https://issues.dlang.org/show_bug.cgi?id=22133
|
|
|
|
struct Slice
|
|
{
|
|
bool empty() const;
|
|
int front() const;
|
|
void popFront()() // note: requires a mutable Slice
|
|
{}
|
|
}
|
|
|
|
enum isInputRange1(R) = is(typeof((R r) => r.popFront));
|
|
enum isInputRange2(R) = __traits(compiles, (R r) => r.popFront);
|
|
static assert(isInputRange1!( Slice) == true);
|
|
static assert(isInputRange1!(const Slice) == false);
|
|
static assert(isInputRange2!( Slice) == true);
|
|
static assert(isInputRange2!(const Slice) == false);
|