mirror of
https://github.com/dlang/phobos.git
synced 2025-04-29 14:40:30 +03:00
manual allman brace fixup
This commit is contained in:
parent
1d34a121e9
commit
ca098c57d2
7 changed files with 25 additions and 11 deletions
|
@ -3683,7 +3683,8 @@ if (is(typeof(binaryFun!pred(r.front, s)) : bool)
|
|||
int[][] w = [ [1, 2], [], [3], [4, 5], [] ];
|
||||
static assert(isForwardRange!(typeof(splitter(a, 0))));
|
||||
|
||||
// foreach (x; splitter(a, 0)) {
|
||||
// foreach (x; splitter(a, 0))
|
||||
// {
|
||||
// writeln("[", x, "]");
|
||||
// }
|
||||
assert(equal(splitter(a, 0), w));
|
||||
|
|
|
@ -719,7 +719,9 @@ public:
|
|||
Warning: Casting to/from $(D const) or $(D immutable) may break type
|
||||
system guarantees. Use with care.
|
||||
*/
|
||||
T opCast(T)() pure nothrow @nogc const if (is(Unqual!T == BigInt)) {
|
||||
T opCast(T)() pure nothrow @nogc const
|
||||
if (is(Unqual!T == BigInt))
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -311,7 +311,9 @@ The example above creates a tagged reference to an Object in the struct A. This
|
|||
as $(D taggedPointer), except the first argument which must be a class type instead of a pointer type.
|
||||
*/
|
||||
|
||||
template taggedClassRef(T, string name, Ts...) if (is(T == class)) {
|
||||
template taggedClassRef(T, string name, Ts...)
|
||||
if (is(T == class))
|
||||
{
|
||||
enum taggedClassRef = createTaggedReference!(T, 8, name, Ts).result;
|
||||
}
|
||||
|
||||
|
|
|
@ -828,7 +828,8 @@ public:
|
|||
* auto records = CsvReader!(int,Malformed.ignore,string,char,string[])
|
||||
* (str, ';', '^');
|
||||
*
|
||||
* foreach (record; records) {
|
||||
* foreach (record; records)
|
||||
* {
|
||||
* assert(equal(record, ans));
|
||||
* }
|
||||
* -------
|
||||
|
@ -852,7 +853,8 @@ public:
|
|||
* (str, ["high","low"], ';', '^');
|
||||
*
|
||||
* int[] ans = [76,22];
|
||||
* foreach (record; records) {
|
||||
* foreach (record; records)
|
||||
* {
|
||||
* assert(equal(record, ans));
|
||||
* }
|
||||
* -------
|
||||
|
|
|
@ -275,7 +275,9 @@ class OutputRangeObject(R, E...) : staticMap!(OutputRange, E) {
|
|||
|
||||
|
||||
/**Returns the interface type that best matches $(D R).*/
|
||||
template MostDerivedInputRange(R) if (isInputRange!(Unqual!R)) {
|
||||
template MostDerivedInputRange(R)
|
||||
if (isInputRange!(Unqual!R))
|
||||
{
|
||||
private alias E = ElementType!R;
|
||||
|
||||
static if (isRandomAccessRange!R)
|
||||
|
@ -332,7 +334,9 @@ template MostDerivedInputRange(R) if (isInputRange!(Unqual!R)) {
|
|||
* all relevant range primitives in virtual functions. If $(D R) is already
|
||||
* derived from the $(D InputRange) interface, aliases itself away.
|
||||
*/
|
||||
template InputRangeObject(R) if (isInputRange!(Unqual!R)) {
|
||||
template InputRangeObject(R)
|
||||
if (isInputRange!(Unqual!R))
|
||||
{
|
||||
static if (is(R : InputRange!(ElementType!R)))
|
||||
{
|
||||
alias InputRangeObject = R;
|
||||
|
@ -465,7 +469,9 @@ template InputRangeObject(R) if (isInputRange!(Unqual!R)) {
|
|||
/**Convenience function for creating an $(D InputRangeObject) of the proper type.
|
||||
* See $(LREF InputRange) for an example.
|
||||
*/
|
||||
InputRangeObject!R inputRangeObject(R)(R range) if (isInputRange!R) {
|
||||
InputRangeObject!R inputRangeObject(R)(R range)
|
||||
if (isInputRange!R)
|
||||
{
|
||||
static if (is(R : InputRange!(ElementType!R)))
|
||||
{
|
||||
return range;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Written in the D programming language.
|
||||
// Written in the D programming language.
|
||||
|
||||
/**
|
||||
Standard I/O functions that extend $(B core.stdc.stdio). $(B core.stdc.stdio)
|
||||
|
@ -2583,7 +2583,7 @@ $(D Range) that locks the file and allows fast writing to it.
|
|||
}
|
||||
|
||||
// @@@BUG@@@ 2340
|
||||
//void front(C)(C c) if (is(C : dchar)) {
|
||||
//void front(C)(C c) if (is(C : dchar))
|
||||
/// ditto
|
||||
void put(C)(C c) @safe if (is(C : const(dchar)))
|
||||
{
|
||||
|
|
|
@ -1574,7 +1574,8 @@ ptrdiff_t indexOfAny(Char,Char2)(const(Char)[] haystack, const(Char2)[] needles,
|
|||
}
|
||||
|
||||
///
|
||||
@safe pure unittest {
|
||||
@safe pure unittest
|
||||
{
|
||||
import std.conv : to;
|
||||
|
||||
ptrdiff_t i = "helloWorld".indexOfAny("Wr");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue