Commit graph

15600 commits

Author SHA1 Message Date
Luís Ferreira
d19c437da9
std.typecons: make Nullable payload void initialized
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2021-08-29 18:41:47 +01:00
Razvan Nitu
5ab9ad2561
Merge pull request #8034 from andralex/NoDuplicates
Improve and simplify NoDuplicates - uses alias assignment
2021-08-27 22:15:18 +08:00
Razvan Nitu
4d58eab1ec
Merge pull request #8033 from andralex/Erase
Simplify and improve Erase and EraseAll
2021-08-27 22:09:47 +08:00
The Dlang Bot
0987031978
Merge pull request #8044 from andralex/Repeat
Use alias assignment in Repeat

Signed-off-by: Razvan Nitu <RazvanN7@users.noreply.github.com>
Merged-on-behalf-of: Razvan Nitu <RazvanN7@users.noreply.github.com>
2021-08-27 13:40:14 +00:00
Andrei Alexandrescu
8d4cd43e44 Use alias assignment in Stride 2021-08-27 12:54:16 +00:00
Andrei Alexandrescu
6544a814e6 Improve Reverse 2021-08-27 11:57:51 +00:00
Andrei Alexandrescu
b0bca9b8e1 Fix wrong decimal separators 2021-08-27 13:11:12 +03:00
Andrei Alexandrescu
b452fcbd92 Use alias assignment in Repeat 2021-08-27 13:11:12 +03:00
Andrei Alexandrescu
880c61827a On second thought, simply have DerivedToFront call staticSort 2021-08-27 13:09:18 +03:00
Andrei Alexandrescu
342b4ee90d Simpler implementation 2021-08-27 13:09:18 +03:00
Andrei Alexandrescu
cd5f2e6a9b Use mergesort for DerivedToFront 2021-08-27 13:09:18 +03:00
The Dlang Bot
a3ff6701be
Merge pull request #8217 from kubo39/doc-preExecFunction
Note that all of the code in preExecFunction must be async-signal-safe

Signed-off-by: Nicholas Wilson <thewilsonator@users.noreply.github.com>
Signed-off-by: Razvan Nitu <RazvanN7@users.noreply.github.com>
Merged-on-behalf-of: Razvan Nitu <RazvanN7@users.noreply.github.com>
2021-08-26 18:44:03 +00:00
Robert burner Schadek
ba80631325 std.csv allow un equal number of value separators
By default `std.csv` will throw if there is an number of separators on a line
unequal to the number of separators of the first line.
To allow, or disallow, unequal numbers of separators a `bool` can be passed to
all overloads of the `csvReader` function as shown below.

```
string text = "76,26,22\n1,2\n3,4,5,6";
auto records = text.csvReader!int(',', '"', true);

assert(records.equal!equal([
    [76, 26, 22],
    [1, 2],
    [3, 4, 5, 6]
]));
```

working in the comments from the PR

more review changes

one more round of review fixes

there is always one left
2021-08-26 15:37:24 +00:00
Hiroki Noda
e1bb58a742 rendered in red warning 2021-08-26 22:34:51 +09:00
Hiroki Noda
1aad510fb3 Note that all of the code in preExecFunction must be async-signal-safe 2021-08-26 21:52:14 +09:00
Iain Buclaw
f9fc1f612a std.bitmanip: Add testbitarray from dmd testsuite as a unittest 2021-08-26 12:41:35 +00:00
Iain Buclaw
213660d9bd std.mmfile: Add testmmfile from dmd testsuite as a unittest 2021-08-26 12:17:32 +00:00
dkorpel
53086d4ffc remove workaround for issue 20150 2021-08-25 23:36:22 +02:00
Iain Buclaw
1cbbb845af std.math: Reference Issue 5305 in unittest taking pointer to function 2021-08-25 19:27:16 +00:00
Iain Buclaw
23c8eaa74c std.random: Add test for Issue 8671 2021-08-25 12:24:18 +00:00
Razvan Nitu
12b78bdebf
Merge pull request #8208 from pbackus/fix-22117
Fix Issue 22117 - Can't store scope pointer in a SumType
2021-08-24 21:16:10 +08:00
Razvan Nitu
8631dbf92c
Merge pull request #8200 from WalterBright/hnsec
define hnsec
2021-08-24 16:46:06 +08:00
Razvan Nitu
27f37ac34a
Merge pull request #8199 from ljmf00/fix-asm-tan-impl
std.math.trigonometry: fix tan asm x86 implementation for ldc compiler
2021-08-24 16:45:20 +08:00
Paul Backus
5ac515b52c Fix Issue 22117 - Can't store scope pointer in a SumType
Previously, the assignment of the local variable 'newStorage' to the
longer-lived member variable 'storage' caused scope inference to
(correctly) fail.

newStorage was necessary to work around issues 21229 and 22118. Since
those issues have been fixed, newStorage can be safely removed.
2021-08-23 21:52:40 -04:00
Luís Ferreira
62e01fc442
std.math.trigonometry: fix tan asm x86 implementation for ldc compiler
Somehow, separating asm blocks in small pieces produces additional
`mov`s and other instructions on LDC that breaks the tanAsm logic and
therefore returns wrong values.

Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2021-08-21 17:29:15 +01:00
Max Haughton
6338c93423
Update std/datetime/systime.d
Co-authored-by: Luís Ferreira <contact@lsferreira.net>
2021-08-20 00:08:00 +01:00
Paul Backus
f96f8046d9 Fix Issue 22225 - SumType: Some assignments should be able to execute in safe code 2021-08-19 23:07:12 +00:00
Walter Bright
08125241e0 define hnsec 2021-08-19 13:46:57 -07:00
nordlow
d30a978370 Qualify Mallocator members as const 2021-08-19 12:18:29 +02:00
Luís Ferreira
8514636059 std.math.algebraic: use fabs from druntime
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2021-08-19 09:56:55 +00:00
Luís Ferreira
6fa9189df9 std.stdio: change exit(0) to _exit(0) to prevent segfault
Fixes #22222.

`exit(0)` call from libc does an exit sequence before exit and therefore
doesn't exit immediately. This causes problems on custom unittest runners. To
circunvent this problem we should call `_exit()` syscall to exit immediately.
In this context this is just fine to do and can prevent any future frustration
when debugging.

Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2021-08-19 04:23:46 +00:00
Razvan Nitu
c143cb5bf1
Merge pull request #8185 from vladchicos/issue_19727
[DSSv3] Fix Issue 19727 - std.algorithm.endsWith fails to compile while startsWith succeeds
2021-08-16 17:25:37 +08:00
Razvan Nitu
4239ed8ebd
Merge pull request #8190 from bitbckt/outbuffer-ctfe
Add compile-time checked variants of writef and writefln to std.outbuffer.
2021-08-13 16:43:03 +08:00
Paul Backus
32f32525bf Fix issue 22077 - std.sumtype support for copy constructors is incomplete
Previously, SumType would define the wrong set of constructors for types
whose copyability varies depending on their mutability--a situation that
was impossible with postblits, but is now possible with copy
constructors.
2021-08-12 03:23:11 +00: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
Razvan Nitu
8904398152
Merge pull request #8188 from dkorpel/rbtree-trusted
Mark RBNode.left and RBNode.right `@trusted`
2021-08-10 17:25:49 +08:00
Brandon Mitchell
68c9430f19 Add compile-time checked variants of writef and writefln to std.outbuffer. 2021-08-09 14:21:54 -07:00
Martin Nowak
31a946b999 Merge remote-tracking branch 'upstream/stable' into merge_stable
Conflicts:
	std/typecons.d
2021-08-09 22:41:03 +02:00
dkorpel
53cd09c1fb mark RBNode.left and RBNode.right @trusted 2021-08-09 12:29:07 +02:00
Mathis Beer
f0372ae659 Fix issue 22176: Revert 51bdf472df
Revert "Fix Issue 20552 - Deprecated Nullable.get warning with Appenders"
`Nullable.get` is removed anyways.
2021-08-07 17:11:55 +00:00
Razvan Nitu
ccecbda25f
Merge pull request #8183 from vladchicos/issue_16210
[DSSv3] Fix Issue 16210 - std.utf.byUTF can be made into a bidirectional range
2021-08-06 14:31:07 +08:00
Razvan Nitu
dc06862fa0
Merge pull request #8176 from ljmf00/fix-functiontypeof
Fix Issue #22140: FunctionTypeOf fails for template opCall without any templated argument
2021-08-04 15:20:31 +08:00
Luís Ferreira
84f7c9b4b5
std/traits: FunctionTypeOf fails for template opCall
Fixes Issue #22140 .

Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2021-08-04 01:47:07 +01:00
vladchicos
9ff8f339aa static if inside the save function 2021-08-03 16:34:59 +03:00
vladchicos
47e5c48f5e different save function for forward and bidirectional ranges 2021-08-03 15:39:58 +03:00
vladchicos
cd9fd4edb8 the description of what byUTF returns is more clear 2021-08-03 15:39:58 +03:00