[Issue 20012] export inside mixin doesn't seem to work

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jul 24 04:15:10 UTC 2019


https://issues.dlang.org/show_bug.cgi?id=20012

--- Comment #13 from Walter Bright <bugzilla at digitalmars.com> ---
One use case is to construct a C callback function, i.e. a pointer to a C
function.

Another is to use C variadic function parameters.

Another is filling a table with C function pointers.

Another is providing an alias to a C function template parameter.

As I mentioned, the use case template mixins were designed for is for multiple
inclusions of boilerplate. This won't work if the declarations conflict.

Besides, I've provided two ways you can get it to work for your case. Since you
are only instantiating a mixin template exactly once, those ways will work.

It's why there is a pragma(mangle) feature. I suspect you're not manually
writing those template mixins, but generating them. Generating a pragma(mangle)
in them should not be a problem.

The string mixin shouldn't be a problem for your case, either.

At least, I don't understand why these would be problems.

--


More information about the Digitalmars-d-bugs mailing list