Merge pull request #3634 from MartinNowak/merge_stable

Merge remote-tracking branch 'upstream/stable' into merge_stable
This commit is contained in:
Hara Kenji 2015-09-08 01:46:43 +09:00
commit bb7e5fb3cc
5 changed files with 67 additions and 28 deletions

View file

@ -2534,8 +2534,10 @@ template reduce(fun...) if (fun.length >= 1)
foreach (/+auto ref+/ E e; r) // @@@4707@@@
{
foreach (i, f; binfuns)
static assert(is(typeof(args[i] = f(args[i], e))),
{
static assert(!is(typeof(f(args[i], e))) || is(typeof(args[i] = f(args[i], e))),
algoFormat("Incompatible function/seed/element: %s/%s/%s", fullyQualifiedName!f, Args[i].stringof, E.stringof));
}
static if (mustInitialize) if (initialized == false)
{