On 12/03/2017 12:42 AM, Johan Engelen wrote:
On Friday, 1 December 2017 at 18:33:09 UTC, Ali Çehreli wrote:
On 12/01/2017 07:21 AM, Steven Schveighoffer wrote:
> On 12/1/17 4:29 AM, Johan Engelen wrote:
>> (Also, I would expect "popFront" to return the element
popped, but it
>> doesn't, OK...
>
On 12/3/17 12:42 AM, Johan Engelen wrote:
On Friday, 1 December 2017 at 18:33:09 UTC, Ali Çehreli wrote:
On 12/01/2017 07:21 AM, Steven Schveighoffer wrote:
> On 12/1/17 4:29 AM, Johan Engelen wrote:
>> (Also, I would expect "popFront" to return the element
popped, but it
>> doesn't, OK...
>
>
On Friday, 1 December 2017 at 18:55:53 UTC, Steven Schveighoffer
wrote:
Once you popFront a byLine range, the element that was at front
is now possibly invalid (the buffer may be reused). So in order
to return the line from popFront, you have to store it
somewhere. This means allocating anoth
On Friday, 1 December 2017 at 18:33:09 UTC, Ali Çehreli wrote:
On 12/01/2017 07:21 AM, Steven Schveighoffer wrote:
> On 12/1/17 4:29 AM, Johan Engelen wrote:
>> (Also, I would expect "popFront" to return the element
popped, but it
>> doesn't, OK...
>
> pop removes the front element, but if getti
On 12/1/17 1:33 PM, Ali Çehreli wrote:
On 12/01/2017 07:21 AM, Steven Schveighoffer wrote:
> On 12/1/17 4:29 AM, Johan Engelen wrote:
>> (Also, I would expect "popFront" to return the element popped, but it
>> doesn't, OK...
>
> pop removes the front element, but if getting the front elemen
On 12/01/2017 07:21 AM, Steven Schveighoffer wrote:
> On 12/1/17 4:29 AM, Johan Engelen wrote:
>> (Also, I would expect "popFront" to return the element popped, but it
>> doesn't, OK...
>
> pop removes the front element, but if getting the front element is
> expensive (say if it's a map with a co
On 12/01/2017 01:11 AM, Johan Engelen wrote:
I tested it and it works like you wrote, but the behavior is different
for an array of integers...:
auto a = [ 1,2,3 ];
writeln(a.front); // 1
auto b = a.moveFront();
writeln(b); // 1
writeln(a.length); // still 3
writeln(a.front); // still 1
-Joha
On 12/1/17 4:29 AM, Johan Engelen wrote:
On Friday, 1 December 2017 at 09:11:40 UTC, Johan Engelen wrote:
I tested it and it works like you wrote, but the behavior is different
for an array of integers...:
Hmm, I guess I misread what Ali meant. But the documentation is
wrong/very confusing
On Friday, 1 December 2017 at 09:11:40 UTC, Johan Engelen wrote:
I tested it and it works like you wrote, but the behavior is
different for an array of integers...:
Hmm, I guess I misread what Ali meant. But the documentation is
wrong/very confusing for moveFront:
It says "moveFront -- Remov
On Thursday, 30 November 2017 at 06:36:12 UTC, Ali Çehreli wrote:
import std.range;
struct S {
int i;
bool is_a_copy = false;
this(this) {
is_a_copy = true;
}
}
void main() {
auto r = [S(1)];
auto a = r.front;
assert(a.is_a_copy); // yes, a is a copy
On 11/30/2017 07:31 AM, Tony wrote:
On Thursday, 30 November 2017 at 09:50:37 UTC, Tony wrote:
On Thursday, 30 November 2017 at 09:47:14 UTC, Tony wrote:
Thanks for the reply. Probably just missing it, but in poking around
dlang.org (Language Reference and Library Reference) I am having
troub
On Thursday, 30 November 2017 at 09:50:37 UTC, Tony wrote:
On Thursday, 30 November 2017 at 09:47:14 UTC, Tony wrote:
Thanks for the reply. Probably just missing it, but in poking
around dlang.org (Language Reference and Library Reference) I
am having trouble finding out about the move(), fron
On Thursday, 30 November 2017 at 09:47:14 UTC, Tony wrote:
Thanks for the reply. Probably just missing it, but in poking
around dlang.org (Language Reference and Library Reference) I
am having trouble finding out about the move(), front() and
moveFront() functions, as is used here on a dynamic
On Thursday, 30 November 2017 at 06:36:12 UTC, Ali Çehreli wrote:
move is an operation that transfers the state of the source to
the destination. The front element becomes its .init value and
its previous values is returned by moveFront().
The important bit is that, the element is *not* cop
On 11/29/2017 08:31 PM, Tony wrote:
What does the moveFront() method do in the InputRange interface?
std.range.interfaces : InputRange.moveFront()
move is an operation that transfers the state of the source to the
destination. The front element becomes its .init value and its previous
values
What does the moveFront() method do in the InputRange interface?
std.range.interfaces : InputRange.moveFront()
16 matches
Mail list logo