Help me write "saveAll"
monarch_dodra
monarchdodra at gmail.com
Fri Dec 21 11:50:08 PST 2012
On Friday, 21 December 2012 at 17:27:32 UTC, H. S. Teoh wrote:
> On Fri, Dec 21, 2012 at 06:01:13PM +0100, monarch_dodra wrote:
>> There are a lot of algorithms in std.algorithm that operate on
>> "foo(Range, Needles...)(Range range, Needles needles)".
>>
>> Needles can be anything, in particular, either an "element" or
>> a
>> "range".
>>
>> The thing is that every now and then, you want to save the
>> entirety
>> of (the ranges) inside needles. EG, I want to be able to write:
>> foo(range, needles.saveAll);
>>
>> I'm having trouble. I did two iterations:
> [...]
>> Any thought on how do get this working?
>
> What about using a mixin? I know it's ugly, but at least you
> don't have
> to copy-n-paste lots of boilerplate every time.
>
>
> T
Hum. That's a solution I guess. I'm tying to see if I can't get
something to work with Tuple and ParameterTypeTuple...
More information about the Digitalmars-d-learn
mailing list