Should alias expand visibility?
Nick Sabalausky
a at a.a
Mon Jul 26 11:55:21 PDT 2010
"Steven Schveighoffer" <schveiguy at yahoo.com> wrote in message
news:op.vggrccq3eav7ka at localhost.localdomain...
> On Mon, 26 Jul 2010 13:59:42 -0400, Tomek Sowinski <just at ask.me> wrote:
>
>> Steven Schveighoffer wrote:
>>
>>> On Sun, 25 Jul 2010 18:23:52 -0400, Tomek Sowinski <just at ask.me> 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;
>> }
>>
>> private:
>>
>> // 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.
>
> Sorry you had to go through that. My post was an attempt at dry humor ;)
>
> -Steve
Heh, now I get it too. Good one :)
More information about the Digitalmars-d
mailing list