Commit graph

505 commits

Author SHA1 Message Date
Tobias Pankrath
b8811d8de0 range: add example to search a SortedRange by key member 2021-03-05 03:04:38 +01:00
Bernhard Seckinger
9cb7755041 Replace approxEqual with isClose 2021-01-28 10:39:50 +01:00
Razvan Nitu
89abc75f02
Merge pull request #7745 from kinke/emplace
Get rid of std.conv.emplace[Ref](), use core[.internal].lifetime
2021-01-25 15:36:04 +08:00
Nathan Sashihara
3733c9d202 Fix Issue 21559 - Speed up walkLength for narrow strings 2021-01-19 10:49:21 -05: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
mhh
c0585bcfa7 Line length 2021-01-17 04:57:51 +00:00
mhh
6708c3abf3 Fix style add @nogc @safe 2021-01-17 03:24:07 +00:00
mhh
03654a7568 Remove uncaught assert that snuck in 2021-01-17 02:22:16 +00:00
mhh
764e3e5a4a signedLength is set properly; adds test coverage too. 2021-01-17 00:38:55 +00:00
mhh
32fd8ce36d Whitesapce fix, bump CI 2021-01-11 00:55:51 +00:00
mhh
d957a66edd Make std.range.enumerate @nogc. The overflow check was using std.conv which cannot be @nogc due the exceptions, it's now done manually. 2021-01-10 22:55:55 +00:00
Vladimir Panteleev
d836d5a76e Revert "Remove some unnecessary undocumented explicit ctors in std.range"
This reverts commit f78fd811f0.
2020-12-19 11:46:40 +00:00
Nathan Sashihara
f78fd811f0 Remove some unnecessary undocumented explicit ctors in std.range 2020-12-02 01:28:49 +01:00
Nathan Sashihara
b3edd8729a Avoid quadratic template expansion in std.range.zip(Ranges).length 2020-12-02 01:27:18 +01:00
Andrei Alexandrescu
71ff9d79c5 EASY: factor implementations of range length into a mixin template 2020-09-20 02:38:14 +02:00
Martin Nowak
498b4b97d6 Merge remote-tracking branch 'upstream/master' into stable
Conflicts:
	posix.mak
2020-09-09 10:18:21 +02:00
Nathan Sashihara
99e390486c Reduce the number of isAggregateType!T checks
Some are redundant. Others can be replaced by cheaper traits checks.
2020-08-18 03:50:12 +02:00
FeepingCreature
1f1a80d0a0
Fix issue 21129: Make OnlyResult store the actual types passed to it as a tuple, instead of a static array of CommonType. (#7584)
Remove the unittest that verifies that `OnlyResult` doesn't depend on argument order - since it now does.
Add unittest for issue 21129.
2020-08-17 13:02:05 -04: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
MoonlightSentinel
f3a336bc7b Remove invalid alias from chain's implementation
The ref has no effect anyway
2020-07-02 15:36:11 +02:00
aG0aep6G
26822f44b5 fix issue 20949 - std.range.popFront is unsafe in release mode 2020-06-18 15:15:46 +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
Steven Schveighoffer
c67e9d1ab9
specify return type for SortedRange.opBinaryRight!"in", as typically one would expect it to be a pointer to an element. 2020-04-19 15:31:28 -04:00
Iain Buclaw
8a38e6e562 std.range.primitives: Fix static condition for X32 targets 2020-04-16 12:21:16 +02: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
Sebastian Wilzbach
4421a4f157 Fix @betterC testsuite 2020-03-04 16:07:28 -08:00
Adam D. Ruppe
ae93f5317c Use consistent quickindex wrapper around hand-written list-of-links tables 2020-02-21 21:04:05 -05:00
dukc
c0070582fd Completed description of PipeOnPop at std.range.tee. 2020-01-30 12:49:40 +02:00
The Dlang Bot
53ba9bb693
Merge pull request #7347 from schveiguy/choosesafe
Fix issue 20495 (choose copies unused union member, which is unsafe)
merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2020-01-10 06:45:26 +01:00
Steven Schveighoffer
ae6de5515d Fix issue 19738. Make trusted parts of ChooseResult.opAssign smaller in case the
individual ranges have system opAssign.
2020-01-09 23:54:58 -05:00
Steven Schveighoffer
857543416d Fix issue 20495. Fixes safety of save function by passing init value of
unused union member to ctor. Also simplify the @safe inference.
2020-01-09 22:17:31 -05:00
tastyminerals
200e3ba3f3
Update package.d 2019-12-04 19:57:32 +00:00
tastyminerals
11add0c0b7
Update package.d 2019-12-04 19:44:48 +00:00
tastyminerals
7ac8ac72e4
Bring back "std.range.dropBack" code examples
For some reason `std.range.dropBack` **Example** field contains examples from `std.range.drop`. I think removing them from here should bring back the actual ones.
2019-12-04 19:24:10 +00:00
The Dlang Bot
68308f50e0
Merge pull request #7253 from FeepingCreature/fix/issue-20314-passing-const-variables-to-only
Fix issue 20314: pass `only` parameters by value
merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2019-11-22 03:29:22 +01:00
dukc
25d3b4b21c Made SortedRange verifications conditionally compiled.
Those verifications broke SortedRange with -betterC even when they were off.
2019-11-13 11:15:22 +02:00
Mathis Beer
f806629e30 Fix issue 20314: pass only parameters by value 2019-10-24 14:26:09 +02:00
Berni
58c3a75738 Fix Issue 15230 - Inconsistent std.range.SortedRange predicate checks 2019-09-29 19:39:05 +02:00
JinShil
0de2d66760 Replace hash_t and sizediff_t with size_t and ptrdiff_t 2019-08-31 04:39:57 +09: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
Walter Bright
46daae056b start making use of isAutodecodableString() 2019-08-12 22:34:38 -07:00
Martin Nowak
d2e931f149 Merge remote-tracking branch 'upstream/stable' into merge_stable 2019-08-05 08:51:49 +02:00
Geod24
808cdd6f34 std.range.enumerate should work with a non-mutable start index
The deduced type for `Enumerator` could contain type modifier
(`const`, `immutable`), but the type was used directly as
a state variable.
2019-07-29 14:02:08 +09:00
David Gileadi
775bcdee51 Turn on -preview=markdown 2019-07-04 10:28:30 -07:00
The Dlang Bot
5a4918e312
Merge pull request #7057 from n8sh/inout-front
Add `inout` to range.front to reduce template proliferation
merged-on-behalf-of: Nathan Sashihara <n8sh@users.noreply.github.com>
2019-06-12 12:29:24 +02:00
Nick Treleaven
249853bda4
[docs][std.range.primitives] Add links to array range primitives
It's important to mention this, particularly so the user notices the auto-decoding overloads.
2019-06-11 16:57:27 +01:00
Nathan Sashihara
e5bae1d839 Add inout to std.range.front to reduce template proliferation
The Win32_64 linker error that prevented this from being included in
PR #6743 no longer occurs in CI.
2019-06-06 18:31:34 -04:00
سليمان السهمي (Suleyman Sahmi)
55328d6ef5 Ternary operator doesn't promote characters to integers anymore 2019-05-26 05:17:39 +00:00
سليمان السهمي (Suleyman Sahmi)
6a6dff4004 Ternary operator doesn't promote characters to integers anymore 2019-05-26 03:10:52 +00:00