design question

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Apr 3 13:10:52 PDT 2009


Walter Bright wrote:
> Andrei Alexandrescu wrote:
>> keepStable is a template function that simply wraps the range in a 
>> different type. It's a way to pass information about the range (e.g., 
>> "keep this stable", or "this is sorted already"), to the function 
>> understanding it.
> 
> Would these be composable? I.e.:
> 
>    thisAttribute(thatAttribute(T)) is the same as 
> thatAttribute(thisAttribute(T)) ? Would the algorithm detect the 'inner' 
> attribute?

Great question. Not sure whether I can implement composition to be 
entirely order-invariant, but yes, the algorithm should "see" various 
attributes of the wrapped range.

Andrei



More information about the Digitalmars-d mailing list