Commit graph

873 commits

Author SHA1 Message Date
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
Geod24
b6a9cd8c64 Fix broken link in minElement doc 2020-11-28 20:37:54 +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
Andrei Alexandrescu
311f00f8ac
Merge pull request #7632 from andralex/minmax
Simplify min and max
2020-09-19 16:19:07 -04:00
Andrei Alexandrescu
620a5a042d Push useCodePoint all the way in 2020-09-18 10:43:27 -04:00
Andrei Alexandrescu
e048dbeb18 Review 2020-09-18 10:43:27 -04:00
Andrei Alexandrescu
369ed6edb6 No need for isEmptyRange 2020-09-18 10:42:03 -04:00
Andrei Alexandrescu
890cd7e8b7 A few more minor improvements to std.algorithm.comparison: pushed implementation constraint down, undocument superfluous flag name, allow comparison of lengths involving infinite ranges, simplify implementation of isSameLength 2020-09-18 10:42:03 -04:00
Andrei Alexandrescu
cae6379750 Fix Issue 21249 - clamp() is not stable and is not constrained 2020-09-16 01:20:51 +02:00
Andrei Alexandrescu
639bedbea8 Fix min 2020-09-13 17:25:20 -04:00
Andrei Alexandrescu
43c95c46d8 Improve type computation - a type that defines max could mess things up 2020-09-13 16:43:42 -04:00
Andrei Alexandrescu
423f633fd7 Simplify min and max 2020-09-13 10:47:18 -04: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
Martin Nowak
498b4b97d6 Merge remote-tracking branch 'upstream/master' into stable
Conflicts:
	posix.mak
2020-09-09 10:18:21 +02:00
Andrei Alexandrescu
6194b17295 Fix Issue 21191 - min should be stable: when in doubt, return the first argument 2020-08-28 08:19:40 +02:00
MoonlightSentinel
255f9496d1
Fix Issue 21183 - schwartzSort does not strip const
Fixed by using the unqualified type if possible
2020-08-21 15:06:11 +02:00
Steven Schveighoffer
17ae8fc9be Make it so std.utf can be tested with no autodecoding. 2020-08-17 06:53:34 +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
Martin Nowak
64384cf202 Merge remote-tracking branch 'upstream/stable' into merge_stable 2020-06-24 00:08:51 +02:00
MoonlightSentinel
574f1f594f
Fix issue - sort should move elements instead of copy...
... because it's reordering elements instead. Calling `opAssign` on
unitialized members might also  cause errors if the implementation
requires a valid instance (see `TimSortImpl`)
2020-06-19 09:10:58 +02:00
John Colvin
b8e90f4a22
Fix Issue 20943 - std.algorithm.setops.cartesianProduct fails for ranges with @system popFront (#7519)
Let safety of cartesianProduct.Result.popFront be inferred.
2020-06-18 18:08:14 +09:00
Simen Kjærås
692f909883 Fix issue 20928 2020-06-15 10:11:43 +02:00
The Dlang Bot
a7bd1a3184
Merge pull request #7502 from MoonlightSentinel/move-safe
Fix Issue 20869 - `move` is overly trusting of `opPostMove`
merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2020-05-31 04:33:26 +02:00
MoonlightSentinel
082f8300d9
Fix Issue 20869 - move is overly trusting of opPostMove
Remove the manual check whether move is `@safe` and instead let the
compiler do the attribute interference by adding appropriate @trusted
blocks.

Note:
I could've extend the current checks `trustedMoveImpl` but that could
easily miss other corner cases.
2020-05-29 13:35:07 +02:00
Biotronic
fd59b6a92e Fix issue 19525 2020-05-29 01:18:40 +02:00
Hiroki Noda
4cdc906b3e [Trivial] Use std.meta instead of std.typetuple 2020-05-13 10:49:16 +09:00
Martin Nowak
a7d8def71b Merge remote-tracking branch 'upstream/stable' into merge_stable 2020-05-11 19:29:12 +02:00
Vladimir Panteleev
793a78c588
Fix Issue 20799 - schwartzSort does not pin transformation results with indirections, leading to memory corruption 2020-05-06 09:57:21 +00:00
The Dlang Bot
6db7dce61d
Merge pull request #7459 from MoonlightSentinel/chunk-ref
Fix Issue 20496 - chunkby should support ref predicate
merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2020-04-26 04:28:48 +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
MoonlightSentinel
54dbc0668c
Fix Issue 20751 - SortedRange with ref predicate parameters fails
isTwoWayCompatible should accept functions with ref parameters.
2020-04-26 00:44:39 +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
The Dlang Bot
ffca395ed2
Merge pull request #7441 from Geod24/bugzilla-links
Change all bug ID to links
merged-on-behalf-of: Vladimir Panteleev <CyberShadow@users.noreply.github.com>
2020-04-14 17:42:07 +02:00
Geod24
f349a76c24 Correct issue number: 93532 -> 19532 2020-04-14 23:34:18 +09:00
Steven Schveighoffer
637ba8560e Fix issue 20732. Do not invoke any complex copy construction for
std.algorithm.mutation.swap for the temporary.
2020-04-13 11:33:54 -04: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
1fb724744a Enable @safe on cartesianProduct's Result.popFront
The DMD PR has long been pulled but the comment hasn't been fixed.
2020-04-13 02:34:16 +09:00
Geod24
4c85510313 Improve comment about issue 5710 2020-04-12 22:48:16 +09:00
Atila Neves
85aede0639 Remove version(assert) from TimSort
If `-debug` is passed to the compiler, `version(assert)` is true.
TimSort has a `version(assert)` that checks some invariants, and uses
std.format.format for better error messages. Unfortunately, since it
is templated code, this results in Phobos template instantiations of
`format` in the user's code when `-debug` is used.

Given that default dub builds use `-debug`, this is a very common
problem.

Instead of removing the invariant checks, this changes it so they only
happen when testing Phobos itself.
2020-04-09 19:06:35 +02:00
Atila Neves
69ae443df4 Replace .staticArray with explicit declarations 2020-03-19 16:18:53 +01:00
Atila Neves
825b72dc88 Restore changes to among unittest that fails on Windows 2020-03-19 15:03:20 +01:00
Atila Neves
9a6f9543cf Address style violations 2020-03-18 18:02:01 +01:00
Atila Neves
bdacde79c3 Add @nogc to all relevant unittests in comparison.d 2020-03-18 18:02:01 +01: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
Martin Kinkelin
5497b666e4 std.algorithm.sorting: Enable binary transform function for schwartzSort
Receiving the element's index in the original range as 2nd parameter.
2020-01-25 04:36:33 +01:00
Atila Neves
f049f0fd4b Make one std.algorithm.iteration.map unittest @nogc 2020-01-22 12:51:02 +01:00
Alexandru Militaru
bb62aaca3d Replaced version (unittest) with version (StdUnittest) to avoid unnecessary overhead when compiling with -unittest 2020-01-19 14:05:17 +02:00