Commit graph

278 commits

Author SHA1 Message Date
dkorpel
53cd09c1fb mark RBNode.left and RBNode.right @trusted 2021-08-09 12:29:07 +02:00
Razvan Nitu
b48cca57e8
Merge pull request #8151 from DoctorNoobingstoneIPresume/210615_std_container_array_Payload_insertBack_01h
std.container.Array: insertBack: Extra checks (including addition overflow).
2021-07-28 18:30:26 +08:00
dandrei279
11bf097658
[DSSv3] Fix Issue #21100: Add data() function to std.container.array.Array (#8174)
[DSSv3] Fix Issue #21100: Add data() function to std.container.array.Array

Signed-off-by: Max Haughton <maxhaton@users.noreply.github.com>
Merged-on-behalf-of: Max Haughton <maxhaton@users.noreply.github.com>
2021-07-21 02:23:10 +00:00
Vladimir Panteleev
9baab6030a std.container.array: Hide unintentionally-public unittest
This is a unittest for a bug, not a public example.
2021-07-05 05:40:36 +00:00
DoctorNoobingstoneIPresume
7f9cc3fbbb std.container.Array: insertBack: Extra checks (including addition overflow). 2021-06-22 19:33:33 +03:00
DoctorNoobingstoneIPresume
0b7bf8dc1f std.container.Array: Simplify implementation of length (by calling reserve). 2021-06-14 05:05:39 +00:00
nordlow
4ba167b15b Annotate std/container/dlist.d to please dlang/dmd#12520 2021-05-18 01:58:16 +02:00
DoctorNoobingstoneIPresume
afeb00d580 container.array: RangeT: moveBack: Improve an assertion. 2021-05-04 08:13:40 +02:00
Razvan Nitu
6e11524c6f
Merge pull request #7189 from burner/assert_messages_container_package
adds assert messages to std.container.package
2021-04-21 20:46:12 +08: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
Luís Ferreira
e0bbaf3649 container: array: simplify some unittests by using Array!bool ctor instead
Since ae90bc7, we can simplify unittests by using Array!bool ctor instead of
manually do .insertBack(...). This improves example code readability.

Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2021-01-23 07:26:39 +01:00
Razvan Nitu
d7fd00d792
Merge pull request #7752 from ljmf00/container-array-ctor-bool
container: array: add ctors for Array!bool
2021-01-22 15:30:10 +08:00
Luís Ferreira
ce558d26b1 container: array: add type checks for passed arguments in insertAfter()
insertAfter should receive a valid element or a Range of values according to
type T of the corresponding instance Array!T.

Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2021-01-19 03:42:45 +01:00
Luís Ferreira
ae90bc7d9e
container: array: add ctors for Array!bool
Array!bool should have the same ctors as Array!T for other types.

Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2021-01-18 23:14:26 +00:00
Luís Ferreira
30f71fd570
Fix issues 21555, 21556: container: array: add missing tests for Array!T .insertBack and .insertAfter
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2021-01-18 20:55:12 +00:00
Luís Ferreira
93ebaa7291
Fix issue 21555: std.container.array: insertBack is wrong and should be tested for Array!bool
insertBack() returns 0 inserted elements everytime due to a preformed
.popFront() on the range.

Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2021-01-18 20:54:14 +00: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
Nathan Sashihara
fe1deb2f84 Fix a few places where opDollar could be an alias of length 2020-11-11 02:09:56 +01:00
Simon Naarmann
b0b64c3f41
RedBlackTree.empty: const, .front/.back: inout (#7644)
* RedBlackTree.empty(): Annotated const

RedBlackTree is a template, therefore all other qualifiers
for empty(), length(), and opBinaryRight!"in" will be inferred:
pure, nothrow, @safe, @nogc.

* RedBlackTree.front, .back: inout
2020-09-30 13:29:29 +08:00
Iain Buclaw
68e7cbdbc2 std.container: Fix warnings that memory may be used uninitialized
This is a warning that showed up when running the testsuite in GDC with
the -Wextra flag.  Said warning is by design and based on the assumption
that any function declared to take a const pointer or reference as an
argument reads the pointed-to-object.

In the case of GC.addRange(), the possibility is that a scan could
occur before the memory is initialized, and the GC sees false pointers
as a result of that.
2020-09-16 10:47:10 +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
Steven Schveighoffer
b842a66f57 Move stableRemove alias to correct place 2020-07-11 08:58:22 +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
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
drug007
e4959d4777 Test for issue 20589 2020-02-26 20:05:34 +03:00
The Dlang Bot
3d322b7cc4
Merge pull request #7370 from burner/std.container.rbtree_assert_messages
adding assert messages to rbtree
merged-on-behalf-of: Nathan Sashihara <n8sh@users.noreply.github.com>
2020-02-02 04:24:33 +01:00
The Dlang Bot
6a8350c688
Merge pull request #7369 from burner/std.container.binary_heap_assert_messages
adding assert messages to std.container.binary_heap
merged-on-behalf-of: Nathan Sashihara <n8sh@users.noreply.github.com>
2020-02-02 04:23:10 +01:00
Robert Schadek
a0f381c514 adding assert messages to std.container.binary_heap 2020-01-27 14:10:32 +00:00
Robert Schadek
8456482ec1 adding assert messages to std.container.slist 2020-01-27 09:32:57 +00:00
Robert Schadek
09bede3b80 adding assert messages to rbtree 2020-01-27 09:23:07 +00: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
Robert Schadek
e70d86b75d Add assert messages for container.array (#7190) 2019-11-04 13:08:28 +02:00
Bernhard Seckinger
79ef683f5c Fix issue 19626 - RedBlackTree of an enum fails in unittest mode 2019-10-17 20:12:22 +02:00
Robert burner Schadek
6786e4228e Geod24 typo fixes 2019-09-21 15:12:25 +01:00
Robert Schadek
a670c53592 adds assert messages to std.container.dlist 2019-09-20 12:30:32 +08:00
Robert Schadek
0cd5c58793 adds assert messages to std.container.package 2019-09-20 12:04:42 +08:00
Nathan Sashihara
d35c93dac7 Avoid mulu in std.container.array.Array!T when T.sizeof == 1
LDC 1.15 and GDC with optimizations enabled recognize that mulu
with a second argument of 1 will never overflow and elide unnecessary
operations but DMD and LDC 1.14 do not.
2019-06-01 08:50:23 -04:00
Walter Bright
fc84e14d54 std.container.rbtree: compile with -dip1000 2019-03-20 12:15:19 -07:00
Walter Bright
fbfd844fd9 rbtree _add need only return a bool 2019-03-19 22:56:01 -07:00
Walter Bright
bc3dd0afda Even more scope for FormatSpec 2019-03-18 01:28:47 -07:00
tibi77
7ae2e67a47 Remove redundant body of @disable functions. Issue 14854 DMD (#6893)
Remove redundant body of @disable functions. Issue 14854 DMD
merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2019-03-06 02:00:04 +01:00
Bastiaan Veelo
79043ed54a
Remove underscore. 2019-02-21 12:12:57 +01:00
Nathan Sashihara
dcca23edca Fix Issue 19164 - malloc may be considered pure when failure results in program exit (no need to reset errno) 2018-11-17 17:00:16 -05:00
Iain Buclaw
fd5facfe04 posix.mak: Enforce whitespace before opening parenthesis for version conditions 2018-09-22 16:57:24 +02:00
Nathan Sashihara
9f42f1f686 Simplify newly-added RedBlackTree.toHash 2018-09-01 14:33:41 -04:00
Vlad Vitan
e61f897381 Fix Issue 18683 - no toHash in rbtree 2018-09-01 14:08:33 -04:00
Steven Schveighoffer
5a3a181922 Fix issue 19171 - Fix invalid assert in Array!bool slicing 2018-08-15 14:24:51 -04:00
Sebastian Wilzbach
84b98fc3f0 Remove invalid Markdown backticks in std.{container,path,random}.d 2018-06-19 22:04:01 +02:00
Sebastian Wilzbach
c324714fde Remove a few cases of underscore escaping 2018-06-04 13:05:01 +02:00
Martin Nowak
b2016be155 fix Issue 18800 - Array.length setter segfaults for payloads with indirections 2018-04-30 09:39:52 +02:00