Commit graph

270 commits

Author SHA1 Message Date
H. S. Teoh
08be61029e Clarify that .uniq by default expects a sorted range. 2022-12-09 03:18:46 +01:00
The Dlang Bot
b026e490c4
Merge pull request #8580 from jamesragray/b18975
Make permutations into forward range.

Signed-off-by: Razvan Nitu <RazvanN7@users.noreply.github.com>
Signed-off-by: H. S. Teoh <quickfur@users.noreply.github.com>
Merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2022-09-27 01:05:31 +02:00
james
872bb2cdb4 Fixed a typo in comment. 2022-09-26 22:49:44 +02:00
james
8744064c6f Fix issue 23362: Permutations should be a forward range. 2022-09-23 22:39:15 +02:00
james
cd42a6a81f Style fixes. 2022-09-21 23:10:20 +02:00
james
370f14af6d Make permutations into forward range. 2022-09-21 23:00:20 +02:00
james
d2b8a15e69 Added unittest related to fix, and moved unittest related to issue to std/algorithm/iterartion.d 2022-09-19 22:27:22 +02:00
Walter Bright
cf3f60c359 iteration: use static class 2022-08-18 11:27:21 -07:00
Paul Backus
4d0e74ba1c
std.algorithm: improve documentation of filter (#8514)
std.algorithm: improve documentation of filter

Signed-off-by: Razvan Nitu <RazvanN7@users.noreply.github.com>
Merged-on-behalf-of: Petar Kirov <PetarKirov@users.noreply.github.com>
2022-07-24 20:19:21 +00:00
Mathis Beer
0a228d72a8 Fix issue 22561: Allow joiner to reassign range values that contain immutable fields. 2021-12-03 14:10:32 +01:00
Adam D. Ruppe
ff6920bd8a Fix issue #22359 - joiner over an empty forward range object liable to segfault
If you pass it a range of class-based ranges, the initialization to
`typeof(_current).init` will be `null`. Calling the `save` method
on `null` will naturally be a memory violation. This generic check
will handle null without harming any other type since save of any
init value will be another init value.
2021-10-07 10:34:35 -04:00
Johan Engelen
93ccfd21c3 Remove unused and inaccessible std.iteration.algorithm.aggregate(...) 2021-09-04 12:09:48 +00:00
Ate Eskola
eea0174127 Extra commenting on postblits, and removed needless trusted lambda 2021-08-30 16:14:53 +03:00
Ate Eskola
41355cd4e3 Partially solve issue 18161. splitWhen and chunkBy when using forward ranges is now safe 2021-08-25 22:52:40 +03:00
vladchicos
bbfe30a671 Add clarifications 2021-08-12 05:09:14 +03:00
vladchicos
cba0b3f813 Added more unittests 2021-08-12 05:09:14 +03:00
vladchicos
7a715fe687 Fix for popBack/popFront
popBack/popFront works for RoRs starting and/or ending with empty items
2021-08-12 05:09:14 +03:00
vladchicos
e32b635f05 Added more unittests 2021-08-12 05:09:14 +03:00
vladchicos
68dab0e2e5 Fix Issue 19727 - std.algorithm.endsWith fails to compile while startsWith succeeds. 2021-08-12 05:09:14 +03:00
berni44
b2019ebab0 Narrow imports of std.math in the rest of phobos. 2021-04-21 03:00:57 +02:00
Robert Aron
d8f3d3a815 Add splitter functionality that allows to keep the sentinels
Signed-off-by: Robert Aron <aronrobert293@gmail.com>

Update the Return: section of DDoc

Fix whitespace
2021-04-21 00:33:22 +02:00
Nick Treleaven
899601aa35 Fix assigning size_t to int for "a=i" 2021-03-19 16:18:29 +00:00
Nick Treleaven
18a647bed4 Add separate example for each with index
Remove doc-comment for example that wasn't as clear.
2021-03-19 14:14:09 +00:00
Nick Treleaven
1af0e4d5e9 std.algorithm: tweak each examples
Make first example @safe.
Split opApply example into separate block.
2021-03-19 14:08:37 +00:00
Ate Eskola
d944ca79a5
Fix Issue 13595 - added splitWhen (#7794)
Fix Issue 13595 - added splitWhen
merged-on-behalf-of: Razvan Nitu <RazvanN7@users.noreply.github.com>
2021-03-18 15:27:34 +01:00
Boris Carvajal
276053dd07
Remove a few uses of fully qualified names that rely on a DMD bug 2021-02-22 08:16:13 -03:00
Bernhard Seckinger
9cb7755041 Replace approxEqual with isClose 2021-01-28 10:39:50 +01:00
Martin Kinkelin
1a459c5996 Get rid of std.conv.emplace[Ref](), use core[.internal].lifetime
The emplace() stuff was moved to druntime; for some reason, it's still
in Phobos.

I've diffed the two versions, and they are still almost identical (incl.
unittests); the druntime version appears to have seen some improvements
(e.g., forwarding r/lvalueness of the arguments) in the meantime.
2021-01-17 16:02:25 +01:00
The Dlang Bot
4d7e5829cb
Merge pull request #7625 from jamesragray/chunkbyfix
Issue 14909: Provided a fix for the forward range version of chunkBy …
merged-on-behalf-of: Nathan Sashihara <n8sh@users.noreply.github.com>
2020-09-23 03:05:14 +02:00
Andrei Alexandrescu
71ff9d79c5 EASY: factor implementations of range length into a mixin template 2020-09-20 02:38:14 +02:00
James Gray
40286ea15d Fixed several style problems 2020-09-11 15:26:35 +02:00
James Gray
e32356385e Fixed trailing whitespace at line 2129 of std/algorithm/iteration.d 2020-09-11 15:11:50 +02:00
James Gray
2ed6952a71 Issue 14909: Provided a fix for the forward range version of chunkBy so that it can accept predicates refernce variables in the calling function 2020-09-10 20:42:17 +02:00
Nathan Sashihara
453faadf5b Replace is(Unqual!T == Unqual!U) with is(immutable T == immutable U) for speed & memory usage 2020-08-03 15:07:32 +02:00
Simen Kjærås
692f909883 Fix issue 20928 2020-06-15 10:11:43 +02:00
Biotronic
fd59b6a92e Fix issue 19525 2020-05-29 01:18:40 +02:00
MoonlightSentinel
8fd3b6d3a5
Fix Issue 20496 - chunkby should support ref predicate
Provide an lvalue when checking the predicate
2020-04-26 03:20:42 +02:00
Geod24
62c72ca6ff Follow up review on PR 7441
Steven identified a couple mistakes in the massive round of linkification.
Fixing them here.
2020-04-15 02:15:04 +09:00
Geod24
f349a76c24 Correct issue number: 93532 -> 19532 2020-04-14 23:34:18 +09:00
Geod24
04f3979317 Replace 'Issue XXX' with Bugzilla links
Make the links clickable, as was done in the DMD repository.
Also avoids any ambiguity w.r.t. where the issue is stored.
2020-04-13 16:28:09 +09:00
Geod24
4c85510313 Improve comment about issue 5710 2020-04-12 22:48:16 +09:00
Iain Buclaw
c882086f85 std.algorithm.iteration: Fix typo.
Taken from patch for gdc bugzilla PR other/93756
2020-03-14 19:13:45 +01:00
Atila Neves
f049f0fd4b Make one std.algorithm.iteration.map unittest @nogc 2020-01-22 12:51:02 +01:00
Bernhard Seckinger
66a2ba02fd Fix Issue 15891 - Compiler error when std.algorithm.cache after 2
layers of std.algorithm.map
2020-01-08 16:05:25 +01:00
Marco de Wild
d93e7be91d
Improved error message when calling sum without a default value
If sum() is called, it tries to find a default value by constructing it with 0 (e.g. float(0)). This works for numbers, but produces obscure errors if the value cannot be constructed this way (e.g. issue #19525). The error message now states that the problem lies in the default value and suggests to supply one instead.
2019-12-30 16:11:55 +01:00
Iain Buclaw
bb7bd70fbf Silence warning: struct Rebindable has method toHash, however it cannot be called with const(Rebindable!(const(C))) this. 2019-10-07 23:29:47 +02:00
Martin Kinkelin
7653e97a32 Rewrite dubious refRange() shortcuts in unittests
As preparation for dlang/dmd#10124, which makes elements of array
literals rvalues.
2019-08-15 18:54:08 +02:00
Robert Schadek
35d32abf3a Adds assert messages 2019-06-25 09:39:29 +01:00
The Dlang Bot
ad540ccaa2
Merge pull request #7072 from shove70/patch-4
Fix issue 19823 - std.range.dropOne doesn't drop the element when cal…
merged-on-behalf-of: Jonathan M Davis <jmdavis@users.noreply.github.com>
2019-06-25 08:31:58 +02:00
shove70
83a3ab4d6a Fix issue 19823 - std.range.dropOne doesn't drop the element when called after std.algorithm.iteration.filter 2019-06-18 14:00:00 +08:00