diff --git a/std/datetime.d b/std/datetime.d index 1ca71f59b..a8fab52cc 100644 --- a/std/datetime.d +++ b/std/datetime.d @@ -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); diff --git a/std/exception.d b/std/exception.d index cdf7faf7a..50d17532a 100644 --- a/std/exception.d +++ b/std/exception.d @@ -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; diff --git a/std/traits.d b/std/traits.d index b32dcea0a..b766fc750 100644 --- a/std/traits.d +++ b/std/traits.d @@ -3012,7 +3012,7 @@ unittest static assert(! isFunctionPointer!(foo)); static assert(! isFunctionPointer!(bar)); - static assert(!isFunctionPointer!((int a) {})); + static assert(isFunctionPointer!((int a) {})); } /**