Commit Graph

611 Commits

Author SHA1 Message Date
0835edce1d range.adapter: Add container-range adapters. Fix #67 2019-02-16 08:36:50 +01:00
Nathan Sashihara
a786bdbec5 Use word-wise hash instead of FNV-1a for arrays of word-aligned scalars
Also special case int-aligned scalars on 64-bit machines.
On a 64-bit machine hashing an array of pointers is now ~5.95x faster
with LDC2 and ~8.54x faster with DMD, and hashing an array of ints is
~3.34x faster with LDC2 and ~8.12x faster with DMD.
2019-02-12 10:34:18 -05:00
0bef2ef76d Add sformat() writing to an output range 2019-02-12 07:37:24 +01:00
1d3d750adb Update dmd to 2.084.1 2019-02-11 22:14:59 +01:00
0c8f1eb4ce Deprecate InputRange source for OutputRanges
An output range for E won't be automatically an output range for [E]
anymore. The same, an output range for [E] won't be automatically an
output range for E. Automatic E <-> [E] conversion seems to be a nice
feature at first glance, but it causes much ambiguity.

1) If I want that my output range accepts only UTF-8 strings but not
single characters (because it could be only part of a code point and
look like broken UTF-8 without the remaining code units), I can't do it
because an OutputRange(R, E) can't distinguish between char and string.

2) Here is an example from 2013:

import std.range;
import std.stdio;
Appender!(const(char)[][]) app;
put(app, "aasdf");
put(app, 'b');
writeln(app.data);

This outputs: ["aasdf", "\0"].
Whether it is a common case or not, such code just shouldn't compile.
2019-02-06 07:26:28 +01:00
bf197a6554 Deprecate put() as an OutputRange primitive 2019-02-04 10:49:12 +01:00
7af5c30820 move(): Give compiler an opportunity to optimize
Fix #75.
2019-02-01 06:33:41 +01:00
c1535e8752 typecons.Variant: Make public. Fix #73 2019-01-31 06:33:19 +01:00
5453f6417f typecons.Option: Deprecate alias this 2019-01-30 06:58:02 +01:00
410b865df9 typecons.Option: Fix assigning nothing 2019-01-29 08:24:58 +01:00
4566cf7857 meta.metafunction: Add Enumerate and EnumerateFrom 2019-01-28 08:30:54 +01:00
0a2798cc96 Call postblit when emplacing a struct. Fix #81 2019-01-27 07:18:53 +01:00
a505a033ab net.ip.Address: Address4/Address6 compatibility 2019-01-25 13:07:32 +01:00
1f02ba5042 net.ip: Add Address4 and Address6 wrapper 2019-01-24 07:14:15 +01:00
50aaa170fb Merge remote-tracking branch 'n8sh/retro-slicing' 2019-01-09 18:17:41 +01:00
Nathan Sashihara
ff7d20f167 retro supports slicing if source range supports slicing 2019-01-08 20:19:53 -05:00
03e21d4368 Remove deprecated memory.op.cmp and Entropy class 2018-12-21 20:05:23 +01:00
c293c6c809 container.array: Fix assigning non-copyable values
Fix #59.
2018-12-18 05:37:52 +01:00
e93898d837 Update dmd to 2.083.1 2018-12-17 18:04:36 +01:00
49d7452b33 Make containers work with non-copyable elements
It is the first step. The containers can be at least created with
non-copyable structs without compilation errors now.
Fix #69.
2018-11-24 06:25:55 +01:00
884dc30953 Fix emplacing POD structs 2018-11-23 13:36:31 +01:00
e67a05138e range.primitive: Support non copyable elements
... in all ranges.
2018-11-19 21:37:58 +01:00
7585bf59e7 Add test.stub. Fix #51 2018-11-18 06:32:10 +01:00
0a121d9d19 Disable length when taking from a lengthless range
Fix #79.
2018-11-13 08:29:51 +01:00
9e6f5c3105 Add algorithm.mutation.rotate 2018-11-12 07:54:52 +01:00
3f66782368 Add support for DMD 2.083.0 2018-11-11 07:27:25 +01:00
3c8f6e3435 Merge remote-tracking branch 'n8sh/take-slice' 2018-11-07 07:08:52 +01:00
ee8b7ef719 Merge remote-tracking branch 'retro-retro' 2018-11-06 16:59:57 +01:00
Nathan Sashihara
6b22cd60df take(take(range,...),n) is take(range, n) and use slicing in take like in takeExactly
Also take!R is the same as takeExactly!R when isInfinite!R.
2018-11-05 22:49:10 -05:00
Nathan Sashihara
c290c85088 retro(retro(range)) is range 2018-11-05 18:43:58 -05:00
Nathan Sashihara
65e2e344df Use inout in tanya.range.array functions
This is to reduce distinct generated functions in final executable.
Also add `scope` and `return` to function parameters.
2018-11-05 16:40:48 -05:00
184d307e40 Add range primitive sameHead 2018-11-04 06:31:38 +01:00
8aec781e2a memory.op.equal: Fix parameter documentation 2018-10-30 12:57:09 +01:00
1e46109e50 algorithm.mutation.destroyAll: New
Fix #71.
2018-10-29 11:14:33 +01:00
64ceb0330c
Merge pull request #74 from n8sh/128-bit-fnv
Add FNV constants for size_t == ucent
2018-10-25 20:05:21 +02:00
Nathan Sashihara
b230685595 Add FNV constants for size_t == ucent 2018-10-25 07:07:29 -04:00
ff58b5e81c Add algorithm.mutation.initializeAll 2018-10-24 08:14:15 +02:00
373a192b3a Make hasLvalueElements work with non-copyable 2018-10-22 08:39:38 +02:00
Nathan Sashihara
4e8c9bd28f Use new __traits(isZeroInit) to check for a null initializer at compile time instead of runtime 2018-10-21 18:52:02 -04:00
3b5709821a Add algorithm.mutation.uninitializedFill 2018-10-20 10:42:01 +02:00
a04a04bb96 conv.emplace: Don't call a destructor
Don't call the destructor on uninitialized elements.
2018-10-14 11:30:02 +02:00
d0d682ca65 Update dmd to 2.082.1, Update GDC .gitignore 2018-10-12 19:57:49 +02:00
6d01680685 conv.emplace: Fix emplacing structs w/o this() 2018-10-08 17:51:59 +02:00
4f9927a8c3 Add algorithm.mutation.fill() 2018-10-06 16:00:08 +02:00
a8b18d7603 Deprecate Entropy (leaving platform sources alone)
Also introduces unavoidable breaking change in EntropySource interface:
poll() returns Option!ubyte instead of Nullable.
2018-10-05 13:23:57 +02:00
9364112690 net.ip: Parse embedded Ipv4. Fix #64 2018-10-03 20:49:14 +02:00
772e87739c Replace memory.op.cmp with optimized equal version
Deprecate cmp.
Fix #68.
2018-10-02 08:55:29 +02:00
2a90a812db Add algorithm.searching.count 2018-09-30 15:25:10 +02:00
e68fcc3a38 Remove code deprecated in 0.11.2 and earlier
- conv.to!String
- meta.metafunction.Tuple
- range.adapter.take
- range.adapter.takeExactly
- range.primitive: put()-ting input range into an output one
2018-09-29 09:00:43 +02:00
c5eb2f27be Add algorithm.iteration 2018-09-28 05:40:33 +02:00