Recursive attribute for virtual functions?

arturg var.spool.mail700 at gmail.com
Tue Mar 27 23:34:20 UTC 2018


On Tuesday, 27 March 2018 at 23:23:38 UTC, ag0aep6g wrote:
>
> DMD might accept that, but I don't think it works in a 
> meaningful way. How do you call the @system one?
>
> Looks like the @safe one will always be called, even from 
> @system code:
>
> ----
> import std.stdio;
>
> void talk() @system { writeln("@system"); }
> void talk() @safe { writeln("@safe"); }
>
> void main() @system
> {
>     talk(); /* Prints "@safe". */
> }
> ----

you can call them with __traits(getOverloads, T, "name")[index];

you can overload on types attributes and linkage, but seems like 
you can only merge overloads based on types.


More information about the Digitalmars-d mailing list