Should alias expand visibility?

Tomek Sowiński just at
Mon Jul 26 10:59:42 PDT 2010

Steven Schveighoffer wrote:

> On Sun, 25 Jul 2010 18:23:52 -0400, Tomek Sowiński <just at> wrote:
>> If foo is private but its public alias poo exists, should you be able to
>> use
>> poo? (currently you can't)
> I don't know, it'd be awfully messy, usually people keep it private.

What you mean by "awfully messy"? Compiler internals?

I was asking for aliases and visibility because in my QuantLibD project I 
had this idea:

struct PermutationMatrixExpr(Permutation permut) {
    static if (permut == Permutation.RowWise) {
        alias byPermutationDim byRows;
        alias byPermutationOrthoDim byColumns;
    } else {
        alias byPermutationDim byColumns;
        alias byPermutationOrthoDim byRows;


// Definitions for byPermutationDim & byPermutationOrthoDim


I don't want to expose byPermutationDim & byPermutationOrthoDim because the 
names are not understandable by wide audience. Sure, I could've used a one-
line wrappers, but that means messier code, work for compiler to inline, 
debug mode runs slower, etc.


More information about the Digitalmars-d mailing list