July 03, 2011 [phobos] Questionable unit test in std.functional | ||||
---|---|---|---|---|
| ||||
At the very bottom of std.functional, there is this unit test: /* test for linkage */ { struct S { extern(C) static void xtrnC() {} extern(D) static void xtrnD() {} } auto dg_xtrnC = toDelegate(&S.xtrnC); auto dg_xtrnD = toDelegate(&S.xtrnD); static assert(! is(typeof(dg_xtrnC) == typeof(dg_xtrnD))); } Is there any reason why dg_xtrnC and dg_xtrnD should have different types? As far as I can tell the calling convention of the function should be completely hidden. |
Copyright © 1999-2021 by the D Language Foundation