On Saturday, 15 November 2014 at 14:34:07 UTC, Nordlöw wrote:
What's wrong with my isArray-overload of sorted?
I solved it by replacing
R s = r.dup;
with
auto s = r.dup;
As a follow up I know wonder if it is ok for isArray-overload of
sorted() to have return type ubyte[] if input i
On Saturday, 15 November 2014 at 08:52:45 UTC, Meta wrote:
On Saturday, 15 November 2014 at 03:47:25 UTC, Steven
Schveighoffer wrote:
err... this isn't what you want. That will sort the range, and
then make a copy of the sorted range as an array.
Yes, I didn't see the the second constraint to
On Saturday, 15 November 2014 at 03:47:25 UTC, Steven
Schveighoffer wrote:
Note, there isn't any generic way to say "give me a copy of
this range, as the same type." array is probably the best you
will get. Just make sure you call it *before* you sort, unless
you want both ranges sorted :)
-S
On Saturday, 15 November 2014 at 03:47:25 UTC, Steven
Schveighoffer wrote:
err... this isn't what you want. That will sort the range, and
then make a copy of the sorted range as an array.
Yes, I didn't see the the second constraint to not sort the
original range.
Sort before .array -> origin
On 11/14/14 7:47 PM, Meta wrote:
On Saturday, 15 November 2014 at 00:45:11 UTC, Meta wrote:
On Saturday, 15 November 2014 at 00:33:11 UTC, Nordlöw wrote:
Is there a functional variant of std.algorithm.sort, say sorted, that
returns a sorted copy of its input use typically as
const y = x.sor
On Saturday, 15 November 2014 at 01:01:57 UTC, Nordlöw wrote:
On Saturday, 15 November 2014 at 00:47:57 UTC, Meta wrote:
`sort` returns a SortedRange, so sort is the function you're
looking for.
Sorry, and if you want a copy, just add a `.array` on the end
to create a new array from the retur
On Saturday, 15 November 2014 at 00:47:57 UTC, Meta wrote:
`sort` returns a SortedRange, so sort is the function you're
looking for.
Sorry, and if you want a copy, just add a `.array` on the end
to create a new array from the returned range.
Great!
Should I use std.algorithm.array or std.ar
On Saturday, 15 November 2014 at 00:47:41 UTC, Nordlöw wrote:
On Saturday, 15 November 2014 at 00:45:11 UTC, Meta wrote:
`sort` returns a SortedRange, so sort is the function you're
looking for.
Do you mean std.algorithm.sort?
I want a sort that doesn't mutate its input argument.
In that ca
On Saturday, 15 November 2014 at 00:45:11 UTC, Meta wrote:
On Saturday, 15 November 2014 at 00:33:11 UTC, Nordlöw wrote:
Is there a functional variant of std.algorithm.sort, say
sorted, that returns a sorted copy of its input use typically
as
const y = x.sorted;
?
If not any recommendati
On Saturday, 15 November 2014 at 00:45:11 UTC, Meta wrote:
`sort` returns a SortedRange, so sort is the function you're
looking for.
Do you mean std.algorithm.sort?
I want a sort that doesn't mutate its input argument.
On Saturday, 15 November 2014 at 00:33:11 UTC, Nordlöw wrote:
Is there a functional variant of std.algorithm.sort, say
sorted, that returns a sorted copy of its input use typically as
const y = x.sorted;
?
If not any recommendations on its implementation?
`sort` returns a SortedRange, s
Is there a functional variant of std.algorithm.sort, say sorted,
that returns a sorted copy of its input use typically as
const y = x.sorted;
?
If not any recommendations on its implementation?
12 matches
Mail list logo