no-autodecode -- game plan

Timon Gehr timon.gehr at gmx.ch
Wed Aug 19 14:27:45 UTC 2020


On 19.08.20 15:10, Andrei Alexandrescu wrote:
>>
> 
> Don't copy everything, alias everything that doesn't need change and 
> only add the declarations that should be changed.

But which declarations are those? Aliasing declarations that would 
otherwise be copied verbatim does not work. Consider:

module a;

auto front(R)(R r)if(...){ /* autodecode here */ }
auto algorithm(R)(R r)if(...){ ... r.front; ... }

module b;

auto front(R)(R r)if(...){ /* no autodecode here */
static import a;
alias algorithm=a.algorithm;

This will not do what you want, because aliasing is not equivalent to 
copying.


More information about the Digitalmars-d mailing list