Commit graph

78 commits

Author SHA1 Message Date
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
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
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
Robert Schadek
e70d86b75d Add assert messages for container.array (#7190) 2019-11-04 13:08:28 +02: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
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
Steven Schveighoffer
5a3a181922 Fix issue 19171 - Fix invalid assert in Array!bool slicing 2018-08-15 14:24:51 -04: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
Jack Stouffer
e14f89e170 Make references to input ranges a link to isInputRange 2018-04-08 16:19:57 -04:00
Ryan Frame
e837813478 Fix issue 13642 - Change of length reallocates without notifying GC 2017-12-29 07:24:54 -05:00
n8sh
06d738f069 Fix Issue 17919: Make std.container.Array use pureMalloc
Using pureMalloc like std.typecons.RefCounted does would make it
possible to use std.container.Array in  `pure` code.
2017-10-25 13:14:50 -04:00
The Dlang Bot
8f98afc9ae Merge pull request #5473 from dmarquant/bug12866
Issue 12866: Allows concatenating of std.container.array with static arrays as T.
merged-on-behalf-of: Petar Kirov <ZombineDev@users.noreply.github.com>
2017-06-27 00:41:40 +02:00
Steven Schveighoffer
4de14ab4c9 Change opOpAssign to use auto ref to prevent copying static arrays 2017-06-26 10:54:39 -04:00
Vladimir Panteleev
d0b9555a06
Revert "Sort selective imports"
This reverts commit 998ad51fd7.
2017-06-13 17:51:52 +00:00
Sebastian Wilzbach
998ad51fd7 Sort selective imports 2017-06-12 08:12:09 +02:00
Sebastian Wilzbach
61717ecc7d Sort imports 2017-06-12 07:54:38 +02:00
David Marquant
879f0b9d0a Remove redundant check using binop 2017-06-11 22:27:03 +02:00
David Marquant
7c21752197 Fix Issue 12866 - concatenating to std.container.array of static arrays 2017-06-11 22:24:20 +02:00
Sebastian Wilzbach
e162658601 Fix Issue 17452 - Undefined references in std.container.array 2017-05-29 21:43:37 +02:00
byebye
a7651e327c std.container.Array - do not realloc if enough capacity 2017-03-31 13:02:06 +02:00
byebye
9fddec58c9 std.container.Array - optimize concatenation 2017-03-23 12:58:01 +01:00
byebye
165195936c std.container.Array - documentation cleanup
- add missing details, e.g. about exception being thrown
- fix wrong descriptions
- fix wrong complexity specifications
2017-03-21 00:53:49 +01:00
byebye
1f78675386 Fix initializeAll invocation 2017-03-11 20:22:14 +01:00
byebye
8ba7ce59ba Fix issue 13619 - array capacity not updated when changing length 2017-03-11 18:42:02 +01:00
Sebastian Wilzbach
c36f95280c Remove quickIndex for modules with booktables or only one symbol 2017-03-01 03:59:22 +01:00
Sebastian Wilzbach
a2c6398332 Automatically add spaces to binary operators (==)
command:

sed -E "s/([[:alnum:]]) == ([[:alnum:]])/\1 == \2/g" -i **/*.d
sed -E "s/([[:alnum:]])== ([[:alnum:]])/\1 == \2/g" -i **/*.d
sed -E "s/([[:alnum:]]) ==([[:alnum:]])/\1 == \2/g" -i **/*.d
2017-02-23 00:57:47 +01:00
Andrei Alexandrescu
30724e67d9 Merge pull request #5166 from wilzbach/dscanner-unittest-safe-or-system
Dscanner: let unittest be @safe or @system
2017-02-22 14:44:08 -05:00
Sebastian Wilzbach
a36cec8686 DScanner: automatially set all unattributed unittests to @safe or @system 2017-02-22 05:42:04 +01:00
Sebastian Wilzbach
425ab667a3 Automatically set the range style from a..b -> a .. b
Commands:

sed -E "s/([[:alnum:]])[.][.]([[:alnum:]])/\1 .. \2/g" -i **/*.d
sed -E "s/([[:alnum:]])[.][.] ([[:alnum:]])/\1 .. \2/g" -i **/*.d
sed -E "s/([[:alnum:]]) [.][.]([[:alnum:]])/\1 .. \2/g" -i **/*.d
2017-02-22 05:37:31 +01:00
Sebastian Wilzbach
805c720595 Unify Phobos by ensuring there's always a space after cast(...)
Command:

sed -E 's/([^"])cast\(([^)]*?)\)([[:alnum:]])/\1cast(\2) \3/g' -i **/*.d
2017-02-21 16:40:20 +01:00
Jack Stouffer
ccff296d70 Removed some GC allocations from std.container.array 2017-02-20 14:44:28 -05:00
Bastiaan Veelo
e1c55df579 [doc] Fix argument naming. 2017-02-09 15:35:08 +01:00
Steven Schveighoffer
75627ddb6b I'm not the author of most of these, just RBTree. 2016-09-13 09:25:16 -04:00
Walter Bright
0c8fd57c66 container.array.sorting.d: add overflow checks 2016-08-05 01:02:52 -07:00
Sebastian Wilzbach
539d860380 Fix issue 16331 - std.container.array should allow uncomparable values 2016-07-28 17:24:46 +02:00
Jack Stouffer
dc8e929f85 Removed package wide std.algorithm imports from std.container.array 2016-07-18 09:40:20 -04:00
Jack Stouffer
50476873b0 Removed package wide std.algorithm imports from std.container.array/binaryheap 2016-07-07 09:46:02 -04:00
Jack Stouffer
fb12e930c0 Fixed local imports in std.container.array 2016-06-30 17:54:13 -04:00
Sebastian Wilzbach
ec47ac4224 Remove the WEB macro in favor of HTTP
replacement: sed 's/\$(WEB/\$(HTTP/g' -i **/*.d
2016-06-16 00:14:51 +02:00