[Issue 5076] std.algorithm.sorted / schwartzSorted
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Oct 19 00:20:58 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=5076
Peter Alexander <peter.alexander.au at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |peter.alexander.au at gmail.co
| |m
--- Comment #1 from Peter Alexander <peter.alexander.au at gmail.com> 2010-10-19 00:20:20 PDT ---
This actually seems to be a common pattern.
By "this", I mean:
auto foo(T value)
{
T copy = value.dup;
modify(copy);
return copy;
}
"modify" here could be sort, reverse, schwartzSort, partition etc. which would
give you sorted, reversed, schwartzSorted and partitioned. It's also the same
as defining op+ in terms of op+=.
I have no idea what you would call foo though :-(
arr2 = transformed!(sort)(arr1);
arr2 = mutated!(sort)(arr1);
arr2 = modified!(sort)(arr1);
arr2 = copyModify!(sort)(arr1);
???
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list