mirror of
https://github.com/dlang/phobos.git
synced 2025-04-28 22:21:09 +03:00
Supplemental changes for 3235 & 6714
This commit is contained in:
parent
187ee7133d
commit
d493815bfe
3 changed files with 7 additions and 6 deletions
|
@ -21152,7 +21152,7 @@ unittest
|
|||
//Verify Examples.
|
||||
{
|
||||
auto interval = Interval!Date(Date(2010, 9, 1), Date(2010, 9, 9));
|
||||
auto func = (in Date date)
|
||||
auto func = delegate (in Date date)
|
||||
{
|
||||
if((date.day & 1) == 0)
|
||||
return date + dur!"days"(2);
|
||||
|
@ -21221,7 +21221,7 @@ unittest
|
|||
//Verify Examples.
|
||||
{
|
||||
auto interval = Interval!Date(Date(2010, 9, 1), Date(2010, 9, 9));
|
||||
auto func = (in Date date)
|
||||
auto func = delegate (in Date date)
|
||||
{
|
||||
if((date.day & 1) == 0)
|
||||
return date - dur!"days"(2);
|
||||
|
@ -23468,7 +23468,7 @@ unittest
|
|||
|
||||
//Verify Examples.
|
||||
auto interval = PosInfInterval!Date(Date(2010, 9, 1));
|
||||
auto func = (in Date date)
|
||||
auto func = delegate (in Date date)
|
||||
{
|
||||
if((date.day & 1) == 0)
|
||||
return date + dur!"days"(2);
|
||||
|
@ -25737,7 +25737,7 @@ unittest
|
|||
|
||||
//Verify Examples.
|
||||
auto interval = NegInfInterval!Date(Date(2010, 9, 9));
|
||||
auto func = (in Date date)
|
||||
auto func = delegate (in Date date)
|
||||
{
|
||||
if((date.day & 1) == 0)
|
||||
return date - dur!"days"(2);
|
||||
|
|
|
@ -365,8 +365,9 @@ T enforce(T, string file = __FILE__, size_t line = __LINE__)
|
|||
|
||||
The whole safety and purity are inferred from $(D Dg)'s safety and purity.
|
||||
+/
|
||||
T enforce(T, Dg : void delegate(), string file = __FILE__, size_t line = __LINE__)
|
||||
T enforce(T, Dg, string file = __FILE__, size_t line = __LINE__)
|
||||
(T value, scope Dg dg)
|
||||
if (is(Dg : void delegate()) || is(Dg : void function()))
|
||||
{
|
||||
if (!value) dg();
|
||||
return value;
|
||||
|
|
|
@ -3012,7 +3012,7 @@ unittest
|
|||
static assert(! isFunctionPointer!(foo));
|
||||
static assert(! isFunctionPointer!(bar));
|
||||
|
||||
static assert(!isFunctionPointer!((int a) {}));
|
||||
static assert(isFunctionPointer!((int a) {}));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue