Skip to content

Commit

Permalink
Merge pull request #6521 from BBasile/issue-18837
Browse files Browse the repository at this point in the history
[trivial] fix issue 18837 - MMFile should have opDollar
merged-on-behalf-of: Nathan Sashihara <n8sh@users.noreply.github.com>
  • Loading branch information
dlang-bot committed May 29, 2018
2 parents 1ebda77 + ba81348 commit 0df8d33
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions std/mmfile.d
Expand Up @@ -430,6 +430,11 @@ class MmFile
return size;
}

/**
* Forwards `length`.
*/
alias opDollar = length;

/**
* Read-only property returning the file mode.
*/
Expand Down Expand Up @@ -710,3 +715,9 @@ version(linux)
scope(exit) std.file.remove(fn);
verifyThrown(scoped!MmFile(fn, MmFile.Mode.readWrite, 0, null));
}

@system unittest
{
MmFile shar = new MmFile(null, MmFile.Mode.readWrite, 10, null, 0);
void[] output = shar[0 .. $];
}

0 comments on commit 0df8d33

Please sign in to comment.