Commit Graph

144 Commits

Author SHA1 Message Date
f6056153e3 rename root namespace from util to cruft
This places, at long last, the core library code into the same namespace
as the extended library code.
2018-08-05 14:42:02 +10:00
803acc9a87 relicense under MPL-2.0 2018-08-04 15:14:06 +10:00
c6760c8566 view: don't over qualify the array deduction guide 2018-08-03 16:50:29 +10:00
0cea64fa14 view: disable trivally copyable type warnings in util::read 2018-08-02 00:51:01 +10:00
20df746217 view: don't enforce constness of view iterators in util::read 2018-08-01 20:58:43 +10:00
e92f0dc337 view: add 'read' operation complementing 'extract' 2018-08-01 14:23:09 +10:00
08d8eb942d view: add iterator intersection test 2018-08-01 13:10:43 +10:00
47c912e5e2 view: avoid alignment warnings for view extraction
It is assumed the user is on top of this.
2018-08-01 13:10:11 +10:00
4b9b292848 view: add more assertions for valid consume parameters 2018-08-01 13:09:32 +10:00
5724de752e view: add head/tail accessors that return truncated subviews 2018-08-01 13:09:15 +10:00
2c47a3654d view: add a method to extract type cast bytes from a view 2018-07-30 14:03:02 +10:00
ab495bb0f7 view: reduce ambiguity in make_byte_view 2018-07-30 13:52:25 +10:00
d2b36ebded view: parameterise make_byte_view 2018-07-27 18:28:56 +10:00
f42ae40fcb view: allow arbitrary index types for slice and consume 2018-07-24 15:49:38 +10:00
00651cab7c view: correct constness of make_byte_view 2018-07-18 15:20:42 +10:00
80bc988466 view: add deductions for u32 and u64 2018-07-18 15:20:30 +10:00
493c91eace view: add nodiscard to constant split operations
Any time we have a constant operator we need to warn the user if they
thing the operation is mutating and does not make use of the result.
2018-07-13 14:05:54 +10:00
ad90e10c5d view: remove unnecessary enable_if type 2018-05-10 13:31:51 +10:00
df3a556867 view: add convenience wrappers for addition operators 2018-05-10 12:54:45 +10:00
2c919a6582 view: use alignment cast for casting 2018-05-10 12:54:45 +10:00
ec44c68ce6 view: require fully named types for casting 2018-05-10 12:54:45 +10:00
29702704fb view: improve template deduction guides 2018-05-10 12:48:20 +10:00
4116442e40 debug: don't rely on format for output
debug is relied upon by a great deal of other units so it's very
difficult to include other popular headers like format.hpp without
triggering cyclic dependencies.
2018-05-10 12:44:03 +10:00
2926776c97 view: use universal references for return types
Reduces the possibility that we dereference a temporary from the
internal iterators.
2018-05-08 21:51:09 +10:00
34fc834a29 view: prefer std::next over std::advance
next is slightly less likely to trigger issues dereferencing a temporary
(since we aren't producing an lvalue).
2018-05-08 21:49:27 +10:00
bfa5700df0 view: add string comparison operators 2018-04-01 14:44:15 +10:00
41cf6c3d51 view: slice should be const 2018-04-01 14:44:08 +10:00
7568e34649 view: don't force const iterators for cbegin/cend 2018-03-23 14:40:40 +11:00
58843fb0c7 view: use trivial constructors and assignment
this allows us to fulfil the requirements of TriviallyCopyable which is
useful particularly in dumb allocators and job queues.
2018-03-23 14:10:57 +11:00
2d7e3e5d7d build: prefer iosfwd over iostream 2018-03-22 16:11:13 +11:00
84f8600f85 view: add const array ref template deduction 2018-03-20 13:35:10 +11:00
7e11707c39 view: remove ambiguous operator-
this operation is identical to the more appropriately named 'consume'
which should be used in its stead.
2018-03-02 12:21:38 +11:00
79d19b4f4f view: add noexcept to data()
This prevents GCC from warning about possible noexcept additions
(-Wnoexcept)
2018-02-26 10:55:10 +11:00
db4f09628f view: add make_byte_view convenience method. 2018-02-01 13:49:28 +11:00
8c8a252d9f build: prefer nodiscard over warn_unused_result 2018-02-01 13:47:42 +11:00
35e3f69ad2 maths, view: rationalise equal,almost_equal,==
views should not do elementwise comparisons for equality operators.
they are pairs of iterators and are only equal if their iterators are
equal.

instead, use `equal` for elementwise equality. we update the name of
exactly_equal to perform this operation too.
2018-01-31 19:33:42 +11:00
6f14c7c65b view: allow implicit conversion from const*const* to const** 2018-01-30 16:25:48 +11:00
32a4aa23e5 view: add slicing operation, stolen from python 2018-01-30 12:53:43 +11:00
b4e242ffd4 Merge remote-tracking branch 'origin/master' 2018-01-16 15:17:25 +11:00
c6d025453a view: avoid signed comparison issues with sizes 2018-01-16 13:31:53 +11:00
09aa86f55f crypto: remove cryptography primitives
This code can now be found in libcruft-crypto. It was removed to prevent
people relying on it, and to improve test iteration times in unoptimised
builds.
2018-01-14 17:13:21 +11:00
681768093e hash: use a consistency, less flexible, interface 2018-01-13 15:24:12 +11:00
2f31cb5a1d view: disambiguate equality operators 2018-01-10 18:50:02 +11:00
a2806cfa75 view: add single iterator consume operator 2018-01-10 18:50:02 +11:00
ad02c94511 view: return unsigned types for size 2018-01-10 18:50:02 +11:00
9bb2bdbaba Merge remote-tracking branch 'origin/master' 2018-01-10 17:19:39 +11:00
2713da45f4 format: rework parser for currying support 2018-01-09 16:28:46 +11:00
dc010d87be view: add yet more constructors 2017-12-30 13:40:37 +11:00
f94be34ae4 view: add more constructor variants 2017-12-28 17:50:37 +11:00
9704387fdc view: use auto return type for indexing 2017-12-26 17:34:08 +11:00
1123cfe409 view: add unused_result warning to redim 2017-12-26 17:34:08 +11:00
e1a41c64de view: add increment and decrement methods 2017-12-26 17:34:08 +11:00
a67069a333 view: move ostream operator into header 2017-12-26 17:34:08 +11:00
dc51fa2ed0 view: char constructor shouldn't include null characters 2017-12-26 17:34:08 +11:00
8d317fd41e view: allow multiple iterator types 2017-12-22 12:34:25 +11:00
202c22eee8 view: simplify logical comparator implementation
we remove some duplicate and specific logical comparator specialisations
and instead rely on a base view/view comparator implementation by way of
make_view.
2017-12-20 12:31:52 +11:00
17f1ca8f93 view: add char-view less-than operator 2017-12-19 18:18:10 +11:00
62d5dfcf64 view: add container/view equality operators 2017-12-19 18:18:10 +11:00
e61c4f6e98 view: add constructors from nullptr_t 2017-12-19 18:18:10 +11:00
60a7670326 view: delegate constructors where feasible
this will allow us to reduce code duplication for sanity checks at
construction time.
2017-12-15 18:58:33 +11:00
0351313c36 Merge branch 'master' into coord 2017-11-23 17:24:11 +11:00
34788756d2 build: don't use './' as an include prefix
GCC produces ODR error when including paths of the form './foo' and
'foo' in the same binary. Rather than managing duplication we just
universally pick the absolute form over the relative form.
2017-11-22 16:49:37 +11:00
4641d43742 view: comment style 2017-10-02 14:14:55 +11:00
220e499681 view: make equality consistent 2017-09-15 15:22:51 +10:00
c222e4e960 view: constructor should take iterators by constref
who knows how big the iterators are, or if they can be moved.
2017-09-14 13:24:08 +10:00
015dff80a0 view: add nulling move operations 2017-09-14 13:13:45 +10:00
acfbec871a view: remove noexcept from redim
redim can throw, it shouldn't be noexcept...
2017-08-31 13:51:21 +10:00
367fc1dcb1 view: add redim operation 2017-08-31 13:03:19 +10:00
4a92981379 view: we really don't need a dedicated find function 2017-08-30 15:13:24 +10:00
5634e59dc5 view: don't return references to iterators
we emulate string_view behaviour. modifying our iterators behind our
backs isn't a great way to ensure invariants are kept.
2017-08-01 14:47:44 +10:00
eabf93bc2a view: remove ipp file in preference of inline code 2017-08-01 14:16:55 +10:00
e5090ff916 view: add 'data' accessor call
added for completeness sake. users can now call
std::begin/std::end/std::data
2017-07-28 14:26:49 +10:00
4f398620ab view: add make_cview function for pointers 2017-03-23 14:36:56 +11:00
436df2952f view: add make_view specialisations for std::string 2017-03-17 18:06:02 +11:00
54b26e9f60 view: add two-iterator make_view call 2017-02-21 21:20:15 +11:00
7786d32ba5 view: add inequality operator 2017-02-20 18:10:26 +11:00
3e9b86f33f view: add make_cview function 2016-12-06 15:18:49 +11:00
b027b60be0 view: find function takes const ref 2016-11-17 19:53:19 +11:00
86332b4d3c view: move array constructor to make_array function 2016-11-17 19:53:19 +11:00
ba2c74449f view: make container constructor explicit and constexpr 2016-06-28 14:09:48 +10:00
722dbbe18f view: use decltype for make_view type deduction
some types will not have iterator typedefs but are capable of providing
iterators. use the types that std::begin and friends return instead of
deducing them ourselves.
2016-06-28 14:06:02 +10:00
28d44593d8 view: add make_view, ref-qualifiers, comparators 2016-03-17 18:14:40 +11:00
42806d2060 view: don't include iostream when ostream suffices 2016-03-16 19:28:35 +11:00
bac238a5ef view: remove restrict before calculating value_type
restrict is poorly handled under libstdc++ in gcc-5.3
2016-03-16 19:27:58 +11:00
e1e5efb357 view: indexing operator returns non-const iterators 2016-02-10 13:07:13 +11:00
f610a70950 view: style 2016-02-10 13:07:03 +11:00
4310366987 view: make methods constexpr
the class is used in some constexpr parsing routines, so constexpr for
many methods is required.
2015-09-25 13:41:04 +10:00
56b5c34b5d view: move implementation inline
this allows support for arbitrary iterator types
2015-09-22 18:31:47 +10:00
37f9390ef8 view: template on arbirtrary iterator types 2015-09-21 15:36:05 +10:00
fd319d579b build: make single argument constructors explicit 2015-06-04 22:18:43 +10:00
2658b41ea1 relicence under Apache-2.0 2015-04-13 18:05:28 +10:00
da464968e6 view: add equality operators 2015-02-11 16:43:27 +11:00
e14b17c0bd uri: use begin and end methods, not variables 2015-02-11 16:43:27 +11:00
49e60e576f view: extract span class into standalone class 2015-02-11 16:18:43 +11:00