mirror of
https://github.com/dlang/phobos.git
synced 2025-04-30 15:10:46 +03:00
Adds asserts messages
This commit is contained in:
parent
ad540ccaa2
commit
31d5b848b0
1 changed files with 7 additions and 5 deletions
|
@ -848,7 +848,8 @@ if (isForwardRange!R
|
||||||
}
|
}
|
||||||
|
|
||||||
//Because of @@@8804@@@: Avoids both "unreachable code" or "no return statement"
|
//Because of @@@8804@@@: Avoids both "unreachable code" or "no return statement"
|
||||||
static if (isInfinite!R) assert(0);
|
static if (isInfinite!R) assert(false, R.stringof ~ "must not be an"
|
||||||
|
~ " infinite range");
|
||||||
else return -1;
|
else return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -951,7 +952,8 @@ if (isInputRange!R &&
|
||||||
}
|
}
|
||||||
|
|
||||||
//Because of @@@8804@@@: Avoids both "unreachable code" or "no return statement"
|
//Because of @@@8804@@@: Avoids both "unreachable code" or "no return statement"
|
||||||
static if (isInfinite!R) assert(0);
|
static if (isInfinite!R) assert(false, R.stringof ~ " must not be an"
|
||||||
|
~ " inifite range");
|
||||||
else return -1;
|
else return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2221,7 +2223,7 @@ private R1 simpleMindedFind(alias pred, R1, R2)(R1 haystack, scope R2 needle)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
assert(haystack.empty);
|
assert(haystack.empty, "Haystack must be empty by now");
|
||||||
return haystack;
|
return haystack;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5001,7 +5003,7 @@ if (isInputRange!Range)
|
||||||
///
|
///
|
||||||
@property auto ref front()
|
@property auto ref front()
|
||||||
{
|
{
|
||||||
assert(!empty);
|
assert(!empty, "Can not get the front of an empty Until");
|
||||||
return _input.front;
|
return _input.front;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5016,7 +5018,7 @@ if (isInputRange!Range)
|
||||||
///
|
///
|
||||||
void popFront()
|
void popFront()
|
||||||
{
|
{
|
||||||
assert(!empty);
|
assert(!empty, "Can not popFront of an empty Until");
|
||||||
if (!_openRight)
|
if (!_openRight)
|
||||||
{
|
{
|
||||||
_done = predSatisfied();
|
_done = predSatisfied();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue