[Issue 21347] New: std.functional.adjoin should work in BetterC
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Oct 29 02:10:44 UTC 2020
https://issues.dlang.org/show_bug.cgi?id=21347
Issue ID: 21347
Summary: std.functional.adjoin should work in BetterC
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: enhancement
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: snarwin+bugzilla at gmail.com
Example program:
---
extern(C) int main()
{
import std.functional: adjoin;
alias f = (int n) => n + 1;
alias g = (int n) => n + 2;
alias h = (int n) => n + 3;
alias i = (int n) => n + 4;
auto result = adjoin!(f, g, h, i)(0);
assert(result[0] == 1);
assert(result[1] == 2);
assert(result[2] == 3);
assert(result[3] == 4);
return 0;
}
---
Compiler output:
---
$ dmd -betterC bug.d
/usr/include/dmd/phobos/std/array.d(3243): Error: TypeInfo cannot be used with
-betterC
$ dmd --version
DMD64 D Compiler v2.094.0
---
Note that due to details of the current implementation, only calls to adjoin
with 4 or more template arguments are affected as of Phobos 2.094.0.
--
More information about the Digitalmars-d-bugs
mailing list