43f5db1cc1
view: operator bool should be explicit
...
Implicit bool tends to allow some unexpected behaviour when indexing
with incorrect types. eg, `view<int const*> a; a["foo"];`
2020-09-24 08:05:47 +10:00
fdaa5e1392
assert: split CHECK_LIMIT into INCLUSIVE and INDEX
...
LIMIT hid an off-by-one bug when tests used end iterators. We rename the
assertion to uncover all uses of the flawed implementation, and split it
into an identical assertion, and one intended to protect against
iterator ends.
2020-09-24 08:03:41 +10:00
3ff6873e4c
view: Avoid assertions that print the iterators
...
Not all iterators are printable.
2020-04-27 09:38:12 +10:00
37899b3f8b
view: prefer allocator_traits over allocator for pointer
...
allocator::pointer has been removed in c++20, so we need to be using
allocator_traits::pointer here instead.
2020-02-17 14:30:30 +11:00
9031a12890
view: remove implicit equality for strings
2020-02-17 14:29:09 +11:00
4bea2668c3
view: prefer static_assert over SFINAE for extract
...
This produces more readable error messages, and we are not using
`extract` in a context where we need to disambiguate calls anyway.
2020-01-05 08:28:57 +11:00
f404acfda0
view: allow extract
with mutable pointers
2020-01-01 12:38:22 +11:00
c254846ac2
view: add equal
overload that takes a parameter
2019-11-26 07:49:34 +11:00
7dabd12253
view: add deduction guideline for iterator/int
2019-11-15 14:53:59 +11:00
d975c05c58
view: typos in comments
2019-11-15 14:53:51 +11:00
eb97b5ac01
view: cast to more expressive types when asserting split indices
2019-11-08 11:17:13 +11:00
762678a50f
view: check the index is valid for the subscript operator
2019-11-05 14:16:31 +11:00
0d7c2628f3
view: add noexcept copy/move assign/construct conditions
2019-05-24 12:16:37 +10:00
8beada1646
debug: split debug headers into components
2019-05-17 12:26:08 +10:00
644cae506f
view: move alignment test for cast into the implementation
...
Moving the alignment test from SFINAE into the implementation as a
static_assert means that users don't need to include the implementation
for types where `cast` isn't called. Otherwise, iterator_traits requires
a definition to work with.
2019-05-15 13:03:38 +10:00
da6d5cb2a8
view: add ssize query
2019-05-12 07:53:08 +10:00
52467c056d
view: add implicit bool operator for 'not empty'
2019-05-12 07:52:54 +10:00
2a9be46d54
view: add front
and back
observers
2019-02-08 11:59:24 +11:00
4a4d5f297a
types/traits: use LessThanComparable more consistently
2019-02-03 17:28:53 +11:00
ddc24b076b
view: avoid unsigned comparison warnings in split's assert
2019-02-03 12:29:49 +11:00
f1cf6933a9
view: add more assertions in slicing code
2019-02-03 11:37:03 +11:00
07c4715082
view: style
2019-01-29 21:30:29 +11:00
c24b0fd0f7
view: add validator specialisation
2019-01-29 21:21:18 +11:00
a94ca358a5
view: use a temporary buffer for cruft::read
2019-01-18 17:20:18 +11:00
b9c0716c66
view: use SFINAE to diable casts that can't be aligned
2019-01-18 17:19:39 +11:00
b0d29f94e9
view: add 'tail' query
2019-01-18 17:19:25 +11:00
e7ba296011
view: add assertion that orderable iterators are ordered
2019-01-18 17:19:10 +11:00
f648ad9810
view: allow multibyte targets for make_byte_view
2018-12-19 17:13:47 +11:00
fb7c989487
view: allow construction from anything that has begin/end
2018-12-19 17:12:28 +11:00
3925431838
view: add 'covers' test
2018-12-17 14:46:30 +11:00
60bd71a57b
view: allow multibyte casts in make_byte_view
2018-12-17 14:45:09 +11:00
49b8594a73
view: add some brief explanatory comments
2018-12-16 16:25:04 +11:00
44760c6869
view: protect functions taking indices with enable_if
2018-12-16 13:26:13 +11:00
4b3b001d18
view: provide accessible typedefs for BeginT and EndT
2018-12-16 13:25:41 +11:00
07e66f20d3
view: allow longer words for byte views
2018-12-15 15:38:01 +11:00
888d88a74d
view: return a pair in split
...
A pair documents the intention a lot more closely given we have an
explicit ordering of the two components.
2018-10-30 15:00:48 +11:00
383805af3a
view: remove addition operators
...
The effect of these operators was never particularly clear. It's better
to remove them completely and replace them with explicit function calls.
2018-10-30 15:00:02 +11:00
c383f6579f
view: prefer construction using explicit size over pointer arithmetic
...
This simplifies step through debugging on some containers.
2018-10-04 15:36:35 +10:00
fdbe909fb8
view: prefer construction using explicit size over pointer arithmetic
...
This simplifies step through debugging on some containers.
2018-10-04 14:52:35 +10:00
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