On Friday, 8 April 2016 at 18:27:59 UTC, Laeeth Isharc wrote:
suppose I have a forward or random access range. what's the
best way to compare each element with the element 4 elements
prior to that element? I could map each element to a tuple of
the element and the element 4 bars previously
On Friday, 8 April 2016 at 18:27:59 UTC, Laeeth Isharc wrote:
suppose I have a forward or random access range. what's the
best way to compare each element with the element 4 elements
prior to that element? I could map each element to a tuple of
the element and the element 4 bars previously
On Friday, April 08, 2016 18:27:59 Laeeth Isharc via Digitalmars-d-learn
wrote:
> suppose I have a forward or random access range. what's the best
> way to compare each element with the element 4 elements prior to
> that element? I could map each element to a tuple of the element
> and the
suppose I have a forward or random access range. what's the best
way to compare each element with the element 4 elements prior to
that element? I could map each element to a tuple of the element
and the element 4 bars previously and do it that way. any neater
way ?
I'm trying to write a range-based template that iterates over a range
and returns one of its elements according to some criterion:
ElementType!R choose(R, E)(R range)
if (isInputRange!R)
{
ElementType!R e;
while (!range.empty) {
18.02.2012 2:50, H. S. Teoh пишет:
...
You cannot have ref local variable, so e is a copy in any case. It may
be a class reference or a pointer, so calling potentially non-const
methods is probably not safe here, but assignment shouldn't give you
problems.
On Sat, Feb 18, 2012 at 05:19:52AM +0200, Mantis wrote:
18.02.2012 2:50, H. S. Teoh пишет:
...
You cannot have ref local variable, so e is a copy in any case. It
may be a class reference or a pointer, so calling potentially
non-const methods is probably not safe here, but assignment
18.02.2012 7:51, H. S. Teoh пишет:
On Sat, Feb 18, 2012 at 05:19:52AM +0200, Mantis wrote:
18.02.2012 2:50, H. S. Teoh пишет:
...
You cannot have ref local variable, so e is a copy in any case. It
may be a class reference or a pointer, so calling potentially
non-const methods is probably not
On Sat, Feb 18, 2012 at 08:02:15AM +0200, Mantis wrote:
18.02.2012 7:51, H. S. Teoh пишет:
On Sat, Feb 18, 2012 at 05:19:52AM +0200, Mantis wrote:
18.02.2012 2:50, H. S. Teoh пишет:
...
You cannot have ref local variable, so e is a copy in any case. It
may be a class reference or a pointer,
On Friday, February 17, 2012 22:27:06 H. S. Teoh wrote:
Hmm. But the problem is that I want to be able to handle something like
File.byLine(). Or perhaps what I really need is just to write a wrapper
around File.readln() that ensures immutability, then I can use
isImmutable() to enforce safety
10 matches
Mail list logo