Passing private functions to template algorithms

Max Samukha via Digitalmars-d digitalmars-d at puremagic.com
Wed Jun 8 00:21:17 PDT 2016


On Tuesday, 7 June 2016 at 18:59:03 UTC, Timon Gehr wrote:

>
> I think it is obvious that this should work. Visibility checks 
> need to happen during identifier lookup. This lookup is 
> happening in the module where isFileNothrow is visible.

There is also this inconsistency:

----
module a;

private int _x;
alias x = _x;

private void _foo() {
}
alias foo = _foo;

----
module main;
import a;

void main(string[] args)
{
     x = 1; // ok
     foo(); // a._foo is not accessible
}


What's the reason for this? Should both aliases be private? 
Public?






More information about the Digitalmars-d mailing list