Skip to content

Commit

Permalink
primitives: add scope
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright committed Jun 24, 2018
1 parent 9cecdb8 commit 1d895ec
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions std/range/primitives.d
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ void put(R, E)(ref R r, E e)

@safe pure nothrow @nogc unittest
{
static struct R() { void put(in char[]) {} }
static struct R() { void put(scope const(char)[]) {} }
R!() r;
put(r, 'a');
}
Expand Down Expand Up @@ -532,7 +532,7 @@ pure @safe unittest

@safe pure unittest
{
static struct R() { void put(in char[]) {} }
static struct R() { void put(scope const(char)[]) {} }
R!() r;
putChar(r, 'a');
}
Expand All @@ -559,7 +559,7 @@ pure @safe unittest

@safe unittest
{
void myprint(in char[] s) { }
void myprint(scope const(char)[] s) { }
auto r = &myprint;
put(r, 'a');
}
Expand Down Expand Up @@ -730,7 +730,7 @@ pure @safe unittest
// issue 10571
import std.format;
string buf;
formattedWrite((in char[] s) { buf ~= s; }, "%s", "hello");
formattedWrite((scope const(char)[] s) { buf ~= s; }, "%s", "hello");
assert(buf == "hello");
}

Expand Down Expand Up @@ -830,7 +830,7 @@ enum bool isOutputRange(R, E) =
///
@safe unittest
{
void myprint(in char[] s) { }
void myprint(scope const(char)[] s) { }
static assert(isOutputRange!(typeof(&myprint), char));

static assert(!isOutputRange!(char[], char));
Expand Down

0 comments on commit 1d895ec

Please sign in to comment.