design question
BCS
ao at pathlink.com
Fri Apr 3 13:15:38 PDT 2009
Reply to Andrei,
> 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
>
you could do composition by tuple/set unioning and always sort the set (by
.stringof)
More information about the Digitalmars-d
mailing list