why won't byPair work with a const AA?

Olivier FAURE via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Aug 3 01:30:50 PDT 2017


On Wednesday, 2 August 2017 at 18:06:03 UTC, H. S. Teoh wrote:
> On Wed, Aug 02, 2017 at 01:15:44PM -0400, Steven Schveighoffer 
> via Digitalmars-d-learn wrote: [...]
>> The real answer is to have tail modifiers for structs, so you 
>> can do the same thing an array does. Note that if Result is an 
>> array, you CAN use inout:
>> 
>> auto byPair(AA)(inout(AA) aa)
>> {
>>    alias Result = inout(X)[];
>>    return Result(...);
>> }
> [...]
>
> Yeah, this isn't the first time I've run into this.  But then 
> the problem becomes, how do you design tail modifiers for 
> structs?

I understand the general concept you're describing, but what 
exactly are tail modifiers? It's the first time I see this name, 
and my google-fu gives me nothing.


More information about the Digitalmars-d-learn mailing list