Help me write "saveAll"
H. S. Teoh
hsteoh at quickfur.ath.cx
Fri Dec 21 09:25:50 PST 2012
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
--
LINUX = Lousy Interface for Nefarious Unix Xenophobes.
More information about the Digitalmars-d-learn
mailing list