Re: Swap front for char[] input ranges

2016-12-21 Thread RazvanN via Digitalmars-d-learn
On Monday, 19 December 2016 at 20:26:26 UTC, Ali Çehreli wrote: On 12/19/2016 06:09 AM, RazvanN wrote: > [...] wrote: >> [...] InputRanges. >> [...] following > [...] char[] > [...] function, so > [...] http://dlang.org/phobos/std_algorithm_mutation.html#bringToFront [...] No need to mention i

Re: Swap front for char[] input ranges

2016-12-19 Thread Ali Çehreli via Digitalmars-d-learn
On 12/19/2016 06:09 AM, RazvanN wrote: > On Monday, 19 December 2016 at 12:25:02 UTC, Ali Çehreli wrote: >> On 12/19/2016 02:41 AM, RazvanN wrote: >> > [...] >> >> As your comments make it clear below, they cannot be InputRanges. >> >> > [...] >> swapping code >> > [...] >> >> Obivously,

Re: Swap front for char[] input ranges

2016-12-19 Thread RazvanN via Digitalmars-d-learn
On Monday, 19 December 2016 at 12:25:02 UTC, Ali Çehreli wrote: On 12/19/2016 02:41 AM, RazvanN wrote: > [...] As your comments make it clear below, they cannot be InputRanges. > [...] swapping code > [...] Obivously, tmp1 and tmp2 are unusued there. :) > [...] passed. > [...] stat

Re: Swap front for char[] input ranges

2016-12-19 Thread Ali Çehreli via Digitalmars-d-learn
On 12/19/2016 02:41 AM, RazvanN wrote: > Hi, > > I have a function which accepts 2 input Ranges As your comments make it clear below, they cannot be InputRanges. > and swaps the first > element in Range1 with the first element in Range2. The swapping code > looks something like this : > > s

Re: Swap front for char[] input ranges

2016-12-19 Thread Basile B. via Digitalmars-d-learn
On Monday, 19 December 2016 at 10:41:46 UTC, RazvanN wrote: Hi, I have a function which accepts 2 input Ranges and swaps the first element in Range1 with the first element in Range2. The swapping code looks something like this : static if (is(typeof(swap(r1.front, r2.front {

Swap front for char[] input ranges

2016-12-19 Thread RazvanN via Digitalmars-d-learn
Hi, I have a function which accepts 2 input Ranges and swaps the first element in Range1 with the first element in Range2. The swapping code looks something like this : static if (is(typeof(swap(r1.front, r2.front { swap(r1.front, r2.front); } else {