Remove obsolete workaround (#10641)

For resolved bugzilla issue 15777
This commit is contained in:
Inkrementator 2025-02-18 23:42:13 +01:00 committed by GitHub
parent bb0c2953dd
commit d4dd391123
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -446,35 +446,21 @@ if (fun.length >= 1)
auto map(Range)(Range r)
if (isInputRange!(Unqual!Range))
{
import std.meta : AliasSeq, staticMap;
import std.meta : staticMap;
import std.functional : adjoin;
alias RE = ElementType!(Range);
static if (fun.length > 1)
alias _funs = staticMap!(unaryFun, fun);
alias _fun = adjoin!_funs;
// Once https://issues.dlang.org/show_bug.cgi?id=5710 is fixed
// accross all compilers (as of 2020-04, it wasn't fixed in LDC and GDC),
// this validation loop can be moved into a template.
foreach (f; _funs)
{
import std.functional : adjoin;
import std.meta : staticIndexOf;
alias _funs = staticMap!(unaryFun, fun);
alias _fun = adjoin!_funs;
// Once https://issues.dlang.org/show_bug.cgi?id=5710 is fixed
// accross all compilers (as of 2020-04, it wasn't fixed in LDC and GDC),
// this validation loop can be moved into a template.
foreach (f; _funs)
{
static assert(!is(typeof(f(RE.init)) == void),
static assert(!is(typeof(f(RE.init)) == void),
"Mapping function(s) must not return void: " ~ _funs.stringof);
}
}
else
{
alias _fun = unaryFun!fun;
alias _funs = AliasSeq!(_fun);
// Do the validation separately for single parameters due to
// https://issues.dlang.org/show_bug.cgi?id=15777.
static assert(!is(typeof(_fun(RE.init)) == void),
"Mapping function(s) must not return void: " ~ _funs.stringof);
}
return MapResult!(_fun, Range)(r);