Skip to content

Commit

Permalink
Remove redundant dummy arguments for inout support names.
Browse files Browse the repository at this point in the history
  • Loading branch information
denis-sh committed Nov 14, 2012
1 parent bd34cdb commit db1d909
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions std/range.d
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ calling $(D r.empty) has, or would have, returned $(D false).))
template isInputRange(R)
{
enum bool isInputRange = is(typeof(
(inout int _dummy=0)
(inout int = 0)
{
R r = void; // can define a range object
if (r.empty) {} // can test for empty
Expand Down Expand Up @@ -757,7 +757,7 @@ supports the operation $(D put(r, e)) as defined above.
template isOutputRange(R, E)
{
enum bool isOutputRange = is(typeof(
(inout int _dummy=0)
(inout int = 0)
{
R r = void;
E e;
Expand Down Expand Up @@ -815,7 +815,7 @@ object with $(D save) and using it later.
template isForwardRange(R)
{
enum bool isForwardRange = isInputRange!R && is(typeof(
(inout int _dummy=0)
(inout int = 0)
{
R r1 = void;
R r2 = r1.save; // can call "save" against a range object
Expand Down Expand Up @@ -855,7 +855,7 @@ $(D r.empty) has, or would have, returned $(D false).))
template isBidirectionalRange(R)
{
enum bool isBidirectionalRange = isForwardRange!R && is(typeof(
(inout int _dummy=0)
(inout int = 0)
{
R r = void;
r.popBack();
Expand Down Expand Up @@ -921,7 +921,7 @@ are bidirectional ranges only.
template isRandomAccessRange(R)
{
enum bool isRandomAccessRange = is(typeof(
(inout int _dummy=0)
(inout int = 0)
{
static assert(isBidirectionalRange!R ||
isForwardRange!R && isInfinite!R);
Expand Down Expand Up @@ -1048,7 +1048,7 @@ $(D T). If $(D R) is not a range, $(D ElementType!R) is $(D void).
*/
template ElementType(R)
{
static if (is(typeof((inout int _dummy=0){ R r = void; return r.front; }()) T))
static if (is(typeof((inout int = 0){ R r = void; return r.front; }()) T))
alias T ElementType;
else
alias void ElementType;
Expand Down Expand Up @@ -1078,7 +1078,7 @@ $(D ElementType).
template ElementEncodingType(R)
{
static if (isNarrowString!R)
alias typeof((inout int _dummy=0){ R r = void; return r[0]; }()) ElementEncodingType;
alias typeof((inout int = 0){ R r = void; return r[0]; }()) ElementEncodingType;
else
alias ElementType!R ElementEncodingType;
}
Expand Down Expand Up @@ -1115,7 +1115,7 @@ swap(r.front, r.front); // can swap elements of the range
template hasSwappableElements(R)
{
enum bool hasSwappableElements = isForwardRange!R && is(typeof(
(inout int _dummy=0)
(inout int = 0)
{
R r = void;
swap(r.front, r.front); // can swap elements of the range
Expand Down Expand Up @@ -1146,7 +1146,7 @@ r.front = e; // can assign elements of the range
template hasAssignableElements(R)
{
enum bool hasAssignableElements = isForwardRange!R && is(typeof(
(inout int _dummy=0)
(inout int = 0)
{
R r = void;
static assert(isForwardRange!(R)); // range is forward
Expand All @@ -1170,7 +1170,7 @@ can be passed by reference and have their address taken.
template hasLvalueElements(R)
{
enum bool hasLvalueElements = is(typeof(
(inout int _dummy=0)
(inout int = 0)
{
void checkRef(ref ElementType!R stuff) {}
R r = void;
Expand Down Expand Up @@ -1212,7 +1212,7 @@ range-oriented algorithms.
template hasLength(R)
{
enum bool hasLength = !isNarrowString!R && is(typeof(
(inout int _dummy=0)
(inout int = 0)
{
R r = void;
static assert(is(typeof(r.length) : ulong));
Expand Down Expand Up @@ -1276,7 +1276,7 @@ static assert(isInputRange!(typeof(s)));
template hasSlicing(R)
{
enum bool hasSlicing = !isNarrowString!R && is(typeof(
(inout int _dummy=0)
(inout int = 0)
{
R r = void;
auto s = r[1 .. 2];
Expand Down

0 comments on commit db1d909

Please sign in to comment.