mitteLib
Loading...
Searching...
No Matches
bin_data.hpp
Go to the documentation of this file.
1//
2// Created by Pietro Saccardi on 21/12/2020.
3//
4
5#ifndef MLAB_BIN_DATA_HPP
6#define MLAB_BIN_DATA_HPP
7
8#include <algorithm>
9#include <array>
10#include <cstdint>
11#include <limits>
12#include <mlab/byte_order.hpp>
13#include <mlab/log.hpp>
15#include <type_traits>
16#include <vector>
17
18namespace mlab_literals {
19 [[nodiscard]] constexpr std::uint8_t operator""_b(unsigned long long int n);
20}
21
22namespace mlab {
23
24#ifdef MLAB_TRACK_BIN_DATA
25 static constexpr bool track_bin_data_mem = true;
26#else
27 static constexpr bool track_bin_data_mem = false;
28#endif
29
30 template <class Iterator>
31 struct range {
32 Iterator it_begin{};
33 Iterator it_end{};
34
35 constexpr range() = default;
36
37 constexpr inline range(Iterator b, Iterator e) : it_begin{b}, it_end{e} {}
38
39 template <class Container>
40 constexpr explicit range(Container &c) : range{std::begin(c), std::end(c)} {}
41
42 template <class Jterator, class = typename std::enable_if<std::is_convertible_v<Jterator, Iterator>>::type>
43 constexpr range(range<Jterator> other) : it_begin{other.it_begin}, it_end{other.it_end} {}
44
45 template <class Jterator = Iterator, class = std::enable_if_t<std::is_same_v<typename std::iterator_traits<Jterator>::iterator_category, std::random_access_iterator_tag>>>
46 [[nodiscard]] constexpr inline typename std::iterator_traits<Iterator>::difference_type size() const {
47 return std::distance(it_begin, it_end);
48 }
49
53 [[nodiscard]] constexpr inline typename std::add_const_t<typename std::iterator_traits<Iterator>::pointer> data() const {
54 return &*it_begin;
55 }
56
60 [[nodiscard]] constexpr inline typename std::iterator_traits<Iterator>::pointer data() {
61 return &*it_begin;
62 }
63
64 [[nodiscard]] constexpr inline Iterator begin() const { return it_begin; }
65
66 [[nodiscard]] constexpr inline Iterator end() const { return it_end; }
67 };
68
69 template <class Iterator>
70 constexpr inline range<Iterator> make_range(Iterator begin, Iterator end) {
71 return {begin, end};
72 }
73
74 template <class Container>
75 constexpr inline auto make_range(Container &c) {
77 }
78
79 template <class, std::size_t Size>
80 struct tagged_array : public std::array<std::uint8_t, Size> {
81 static constexpr std::size_t array_size = Size;
82
83 [[nodiscard]] bool operator==(tagged_array const &other) const;
84 [[nodiscard]] bool operator!=(tagged_array const &other) const;
85 };
86
87 template <class T>
88 concept is_range_enumerable = requires(T t) {
89 std::begin(t) != std::end(t);
90 *std::begin(t);
91 std::next(std::begin(t));
92 };
93
99 bool v;
100
101 template <class T, class = std::enable_if_t<std::is_same_v<T, bool>>>
102 constexpr explicit_bool(T v_) : v{v_} {}
103
104 constexpr explicit operator bool() const {
105 return v;
106 }
107 };
108
109 struct bit_ref {
110 std::uint8_t &byte;
111 const std::uint8_t index;
112 const std::uint8_t write_mask;
113
115
116 inline explicit operator bool() const;
117 };
118
119 struct prealloc {
120 constexpr inline explicit prealloc(std::size_t size) : requested_size{size} {}
121
122 std::size_t requested_size = 0;
123 };
124
125 using bin_data_base = std::conditional_t<track_bin_data_mem, std::vector<std::uint8_t, tracker_allocator<std::uint8_t>>, std::vector<std::uint8_t>>;
126
127 class bin_data : public bin_data_base {
128 public:
129 bin_data() = default;
130
131 inline bin_data(std::initializer_list<std::uint8_t> data);
132
134
135 inline explicit bin_data(bin_data_base &&data);
136
137 inline explicit bin_data(prealloc const &pa);
138
139 template <class ByteIterator>
140 inline bin_data(ByteIterator begin, ByteIterator end);
141
142 [[nodiscard]] inline range<bin_data::const_iterator> view(
143 std::size_t start = 0,
144 std::size_t length = std::numeric_limits<std::size_t>::max()) const;
145
146 [[nodiscard]] inline range<iterator> view(
147 std::size_t start = 0,
148 std::size_t length = std::numeric_limits<std::size_t>::max());
149
150 [[nodiscard]] inline range<value_type const *> data_view(
151 std::size_t start = 0,
152 std::size_t length = std::numeric_limits<std::size_t>::max()) const;
153
154 [[nodiscard]] inline range<value_type *> data_view(
155 std::size_t start = 0,
156 std::size_t length = std::numeric_limits<std::size_t>::max());
157
158 using bin_data_base::push_back;
159
160 template <class... ByteOrByteContainers>
161 static bin_data chain(ByteOrByteContainers &&...others);
162 };
163
164 template <class T>
165 concept is_injectable = requires(T const &t) {
166 std::declval<bin_data &>() << t;
167 };
168
169 inline bin_data &operator<<(bin_data &bd, prealloc const &pa);
170
171 enum struct stream_ref {
172 beg,
173 pos,
174 end
175 };
176
178 bin_data const *_data = nullptr;
179 std::size_t _pos = 0;
180 bool _bad = false;
181
182 [[nodiscard]] inline std::size_t get_ref(stream_ref ref) const;
183
184 public:
185 bin_stream() = default;
186
187 inline explicit bin_stream(bin_data const &data, std::size_t position = 0);
188
189 inline void seek(std::intptr_t offset, stream_ref ref = stream_ref::beg);
190
191 [[nodiscard]] inline std::size_t tell(stream_ref ref = stream_ref::beg) const;
192
193 [[nodiscard]] inline std::size_t remaining() const;
194
195 template <class OutputIterator>
196 std::size_t read(OutputIterator it, std::size_t n);
197
198 inline range<bin_data::const_iterator> read(std::size_t n);
199
200 inline std::uint8_t pop();
201
202 [[nodiscard]] inline std::uint8_t peek_one();
203
204 [[nodiscard]] inline range<bin_data::const_iterator> peek() const;
205
206 [[nodiscard]] inline bool good() const;
207
208 [[nodiscard]] inline bool eof() const;
209
210 [[nodiscard]] inline bool bad() const;
211
212 inline void set_bad();
213
214 inline void clear_bad();
215 };
216
217 template <class T>
218 concept is_extractable = requires(T &t) {
219 std::declval<bin_stream &>() >> t;
220 };
221
222 template <unsigned Bits>
223 struct lsb_t {};
224
225 template <unsigned Bits>
226 struct msb_t {};
227
228 [[maybe_unused]] static constexpr lsb_t<16> lsb16{};
229 [[maybe_unused]] static constexpr lsb_t<24> lsb24{};
230 [[maybe_unused]] static constexpr lsb_t<32> lsb32{};
231 [[maybe_unused]] static constexpr lsb_t<64> lsb64{};
232 [[maybe_unused]] static constexpr msb_t<16> msb16{};
233 [[maybe_unused]] static constexpr msb_t<24> msb24{};
234 [[maybe_unused]] static constexpr msb_t<32> msb32{};
235 [[maybe_unused]] static constexpr msb_t<64> msb64{};
236 [[maybe_unused]] static constexpr lsb_t<0> lsb_auto{};
237 [[maybe_unused]] static constexpr msb_t<0> msb_auto{};
238
239 template <unsigned BitSize, byte_order Order>
243
244 template <unsigned BitSize, byte_order Order>
248
249 template <class Num>
250 concept is_signed_or_unsigned_v = std::is_unsigned_v<Num> or std::is_signed_v<Num>;
251
252 template <is_signed_or_unsigned_v Num, unsigned BitSize, byte_order Order>
253 bin_stream &operator>>(ordered_extractor<BitSize, Order> e, Num &n);
254
255 template <is_signed_or_unsigned_v Num, unsigned BitSize, byte_order Order>
256 bin_data &operator<<(ordered_injector<BitSize, Order> i, Num n);
257
258
259 template <unsigned BitSize>
260 inline ordered_extractor<BitSize, byte_order::lsb_first> operator>>(bin_stream &s, lsb_t<BitSize>);
261
262 template <unsigned BitSize>
263 inline ordered_extractor<BitSize, byte_order::msb_first> operator>>(bin_stream &s, msb_t<BitSize>);
264
265 template <unsigned BitSize>
266 ordered_injector<BitSize, byte_order::lsb_first> operator<<(bin_data &bd, lsb_t<BitSize>);
267
268 template <unsigned BitSize>
269 ordered_injector<BitSize, byte_order::msb_first> operator<<(bin_data &bd, msb_t<BitSize>);
270
271 inline bin_data &operator<<(bin_data &bd, explicit_bool b);
272
273 inline bin_stream &operator>>(bin_stream &s, bool &b);
274
275 inline bin_stream &operator>>(bin_stream &s, std::uint8_t &byte);
276
277 template <std::size_t Length>
278 bin_stream &operator>>(bin_stream &s, std::array<std::uint8_t, Length> &out);
279
280 template <class T>
281 using underlying_t = std::conditional_t<std::is_enum_v<T>, std::underlying_type_t<T>, T>;
282
283 template <class T>
284 using range_value_t = std::decay_t<decltype(*std::begin(std::declval<T>()))>;
285
286 template <class T>
287 concept is_byte_enum = std::is_enum_v<T> and std::is_same_v<underlying_t<T>, std::uint8_t>;
288
289 template <class T>
290 concept is_byte_enumerable = is_range_enumerable<T> and std::is_same_v<range_value_t<T>, std::uint8_t>;
291
292 template <class T>
294
295 template <is_byte_enum Enum>
296 bin_stream &operator>>(bin_stream &s, Enum &t);
297
298 template <class T>
299 concept is_byte_sequence = is_byte_enum<T> or is_byte_enumerable<T> or is_byte_enum_enumerable<T> or std::is_same_v<T, std::uint8_t>;
300
301 template <is_byte_sequence T>
302 bin_data &operator<<(bin_data &bd, T const &t);
303
305 } constexpr length_encoded{};
306
307 template <class T>
309 T &s;
310 };
311
314
315 template <class T>
316 concept container_of_injectables = is_range_enumerable<T> and requires(T const &t) {
317 { std::declval<bin_data &>() << lsb32 << std::uint32_t(t.size()) };
318 { std::declval<bin_data &>() << *std::begin(t) };
319 };
320
321 template <class T>
323 t.resize(std::uint32_t{});
324 { std::declval<bin_stream &>() >> *++std::begin(t) };
325 };
326
327 template <container_of_injectables Container>
328 bin_data &operator<<(encode_length<bin_data> w, Container const &c);
329
330 template <container_of_extractables Container>
332
333 static_assert(not is_injectable<int>);
334 static_assert(not is_injectable<std::string>);
336 static_assert(not container_of_injectables<std::string>);
337}// namespace mlab
338
339namespace mlab {
340
341
342 template <class T, std::size_t Size>
344 return std::equal(std::begin(*this), std::end(*this), std::begin(other));
345 }
346
347 template <class T, std::size_t Size>
349 return not operator==(other);
350 }
351
352 bin_data::bin_data(std::initializer_list<std::uint8_t> data) : bin_data_base{data} {}
353
355
357 reserve(pa.requested_size);
358 }
359
360 bin_data::bin_data(range<bin_data::const_iterator> view) : bin_data{std::begin(view), std::end(view)} {}
361
362 template <class ByteIterator>
363 bin_data::bin_data(ByteIterator begin, ByteIterator end) : bin_data_base{begin, end} {}
364
366 bd.push_back(b ? 0x01 : 0x00);
367 return bd;
368 }
369
370 template <class... ByteOrByteContainers>
371 bin_data bin_data::chain(ByteOrByteContainers &&...others) {
372 bin_data retval{};
373 (retval << ... << others);
374 return retval;
375 }
376
377
378 range<bin_data::const_iterator> bin_data::view(std::size_t start, std::size_t length) const {
379 start = std::min(start, size());
380 length = std::min(length, size() - start);
381 return {begin() + difference_type(start), begin() + difference_type(start + length)};
382 }
383
384 range<bin_data::iterator> bin_data::view(std::size_t start, std::size_t length) {
385 start = std::min(start, size() - 1);
386 length = std::min(length, size() - start);
387 return {begin() + difference_type(start), begin() + difference_type(start + length)};
388 }
389
390 range<bin_data::value_type const *> bin_data::data_view(std::size_t start, std::size_t length) const {
391 start = std::min(start, size());
392 length = std::min(length, size() - start);
393 return {data() + start, data() + start + length};
394 }
395
396 range<bin_data::value_type *> bin_data::data_view(std::size_t start, std::size_t length) {
397 start = std::min(start, size() - 1);
398 length = std::min(length, size() - start);
399 return {data() + start, data() + start + length};
400 }
401
403 if (0 != (write_mask & (1 << index))) {
404 if (v) {
405 byte |= 1 << index;
406 } else {
407 byte &= ~(1 << index);
408 }
409 }
410 return *this;
411 }
412
413 bit_ref::operator bool() const {
414 return 0 != (byte & (1 << index));
415 }
416
418 bd.reserve(bd.size() + pa.requested_size);
419 return bd;
420 }
421
422 bin_stream::bin_stream(bin_data const &data, std::size_t position) : _data{&data}, _pos{position}, _bad{false} {}
423
424 void bin_stream::seek(std::intptr_t offset, stream_ref ref) {
425 if (_data != nullptr) {
426 _pos = get_ref(ref) + offset;
427 }
428 }
429
430 std::size_t bin_stream::tell(stream_ref ref) const {
431 if (_data != nullptr) {
432 return _pos - get_ref(ref);
433 }
434 return std::numeric_limits<std::size_t>::max();
435 }
436
437 std::size_t bin_stream::get_ref(stream_ref ref) const {
438 if (_data != nullptr) {
439 switch (ref) {
440 case stream_ref::beg:
441 return 0;
442 case stream_ref::pos:
443 return _pos;
444 case stream_ref::end:
445 return _data->size();
446 }
447 }
448 return std::numeric_limits<std::size_t>::max();
449 }
450
452 if (good()) {
453 return _data->view(_pos);
454 }
455 return {};
456 }
457
459 if (n == 0) {
460 return _data->view(_pos, 0);
461 }
462 if (good()) {
463 const std::size_t old_pos = _pos;
464 if (remaining() < n) {
466 set_bad();
467 } else {
468 _pos += n;
469 }
470 return _data->view(old_pos, _pos - old_pos);
471 }
472 set_bad();
473 return {};
474 }
475
476 bool bin_stream::good() const {
477 return not bad() and not eof();
478 }
479
480 bool bin_stream::eof() const {
481 return _data == nullptr or _pos >= _data->size();
482 }
483
484 bool bin_stream::bad() const {
485 return _data == nullptr or _bad;
486 }
487
489 _bad = true;
490 }
491
493 _bad = false;
494 }
495
496 std::size_t bin_stream::remaining() const {
497 return get_ref(stream_ref::end) - tell();
498 }
499
500 std::uint8_t bin_stream::pop() {
501 if (good()) {
502 return (*_data)[_pos++];
503 }
504 set_bad();
505 return 0x00;
506 }
507
508 std::uint8_t bin_stream::peek_one() {
509 if (good()) {
510 return (*_data)[_pos];
511 }
512 set_bad();
513 return 0x00;
514 }
515
516 template <class OutputIterator>
517 std::size_t bin_stream::read(OutputIterator it, std::size_t n) {
518 const auto data = read(n);
519 std::copy(std::begin(data), std::end(data), it);
520 return std::end(data) - std::begin(data);
521 }
522
524 b = s.pop() != 0x00;
525 return s;
526 }
527
528 bin_stream &operator>>(bin_stream &s, std::uint8_t &byte) {
529 byte = s.pop();
530 return s;
531 }
532
533 template <std::size_t Length>
534 bin_stream &operator>>(bin_stream &s, std::array<std::uint8_t, Length> &out) {
535 s.template read(std::begin(out), Length);
536 return s;
537 }
538
539 template <is_byte_enum Enum>
541 using underlying_t = typename std::underlying_type_t<Enum>;
542 auto value = static_cast<underlying_t>(Enum{});// A valid enum entry
543 s >> value;
544 if (not s.bad()) {
545 t = static_cast<Enum>(value);
546 }
547 return s;
548 }
549
550 template <is_byte_sequence T>
551 bin_data &operator<<(bin_data &bd, T const &t) {
552 if constexpr (is_byte_enum<T>) {
553 bd.push_back(static_cast<std::uint8_t>(t));
554 } else if constexpr (is_byte_enumerable<T>) {
555 bd.reserve(bd.size() + std::distance(std::begin(t), std::end(t)));
556 for (auto const item : t) {
557 bd.push_back(item);
558 }
559 } else if constexpr (is_byte_enum_enumerable<T>) {
560 bd.reserve(bd.size() + std::distance(std::begin(t), std::end(t)));
561 for (auto const be : t) {
562 bd.push_back(static_cast<std::uint8_t>(be));
563 }
564 } else if constexpr (std::is_same_v<T, std::uint8_t>) {
565 bd.push_back(t);
566 }
567 return bd;
568 }
569
570
571 template <unsigned BitSize>
575
576 template <unsigned BitSize>
578 return {s};
579 }
580
581 template <unsigned BitSize>
582 ordered_injector<BitSize, byte_order::lsb_first> operator<<(bin_data &bd, lsb_t<BitSize>) {
583 return {bd};
584 }
585
586 template <unsigned BitSize>
587 ordered_injector<BitSize, byte_order::msb_first> operator<<(bin_data &bd, msb_t<BitSize>) {
588 return {bd};
589 }
590
591 template <is_signed_or_unsigned_v Num, unsigned BitSize, byte_order Order>
593 static_assert(sizeof(Num) * 8 >= BitSize);
594 if constexpr (BitSize == 0) {
595 return ordered_extractor<sizeof(Num) * 8, Order>{e.s} >> n;
596 } else {
597 std::array<std::uint8_t, BitSize / 8> b{};
598 e.s >> b;
600 return e.s;
601 }
602 }
603
604 template <is_signed_or_unsigned_v Num, unsigned BitSize, byte_order Order>
606 static_assert(sizeof(Num) * 8 >= BitSize);
607 if constexpr (BitSize == 0) {
608 return ordered_injector<sizeof(Num) * 8, Order>{i.bd} << n;
609 } else {
610 return i.bd << encode<Order, BitSize, Num>(n);
611 }
612 }
613
615 return {s};
616 }
617
618 encode_length<bin_data> operator<<(bin_data &bd, length_encoded_t) {
619 return {bd};
620 }
621
622 template <container_of_injectables Container>
624 w.s << lsb32 << c.size();
625 for (auto it = std::begin(c); it != std::end(c); ++it) {
626 w.s << *it;
627 }
628 return w.s;
629 }
630
631 template <container_of_extractables Container>
633 std::size_t size = 0;
634 w.s >> lsb32 >> size;
635 if (w.s.bad()) {
636 return w.s;
637 }
638 if (size * sizeof(typename Container::value_type) > 10 * 1024 * 1024) {
639 LOGW("MLAB", "Attempt at extracting > 10MB of data?! %zu items in encoded array.", size);
640 }
641 c.resize(size);
642 for (auto it = std::begin(c); it != std::end(c); ++it) {
643 w.s >> *it;
644 }
645 return w.s;
646 }
647}// namespace mlab
648
649namespace mlab_literals {
650 constexpr std::uint8_t operator""_b(unsigned long long int n) {
651 return std::uint8_t(n);
652 }
653}// namespace mlab_literals
654
655#endif//MLAB_BIN_DATA_HPP
Definition bin_data.hpp:127
range< value_type const * > data_view(std::size_t start=0, std::size_t length=std::numeric_limits< std::size_t >::max()) const
Definition bin_data.hpp:390
static bin_data chain(ByteOrByteContainers &&...others)
Definition bin_data.hpp:371
range< bin_data::const_iterator > view(std::size_t start=0, std::size_t length=std::numeric_limits< std::size_t >::max()) const
Definition bin_data.hpp:378
bin_data()=default
Definition bin_data.hpp:177
bool _bad
Definition bin_data.hpp:180
range< bin_data::const_iterator > peek() const
Definition bin_data.hpp:451
bool good() const
Definition bin_data.hpp:476
std::uint8_t pop()
Definition bin_data.hpp:500
bool bad() const
Definition bin_data.hpp:484
bin_stream()=default
std::size_t _pos
Definition bin_data.hpp:179
void set_bad()
Definition bin_data.hpp:488
bool eof() const
Definition bin_data.hpp:480
void seek(std::intptr_t offset, stream_ref ref=stream_ref::beg)
Definition bin_data.hpp:424
std::size_t remaining() const
Definition bin_data.hpp:496
std::uint8_t peek_one()
Definition bin_data.hpp:508
std::size_t tell(stream_ref ref=stream_ref::beg) const
Definition bin_data.hpp:430
void clear_bad()
Definition bin_data.hpp:492
std::size_t get_ref(stream_ref ref) const
Definition bin_data.hpp:437
std::size_t read(OutputIterator it, std::size_t n)
Definition bin_data.hpp:517
bin_data const * _data
Definition bin_data.hpp:178
Definition bin_data.hpp:322
Definition bin_data.hpp:316
Definition bin_data.hpp:293
Definition bin_data.hpp:287
Definition bin_data.hpp:290
Definition bin_data.hpp:299
Definition bin_data.hpp:218
Definition bin_data.hpp:165
Definition bin_data.hpp:88
Definition bin_data.hpp:250
#define LOGW(tag, format,...)
Definition log.hpp:56
Definition bin_data.hpp:18
Definition log.cpp:8
std::decay_t< decltype(*std::begin(std::declval< T >()))> range_value_t
Definition bin_data.hpp:284
stream_ref
Definition bin_data.hpp:171
static constexpr lsb_t< 0 > lsb_auto
Definition bin_data.hpp:236
static constexpr msb_t< 32 > msb32
Definition bin_data.hpp:234
static constexpr msb_t< 0 > msb_auto
Definition bin_data.hpp:237
bool operator==(tracker_allocator< T > const &, tracker_allocator< U > const &) noexcept
Definition tracker_allocator.hpp:81
bin_data & operator<<(encode_length< bin_data > w, std::string_view sv)
Definition strutils.cpp:155
static constexpr msb_t< 24 > msb24
Definition bin_data.hpp:233
constexpr range< Iterator > make_range(Iterator begin, Iterator end)
Definition bin_data.hpp:70
std::array< std::uint8_t, Bits/8 > encode(Num n)
Definition byte_order.hpp:149
Num decode(std::array< std::uint8_t, Bits/8 > const &b)
Definition byte_order.hpp:168
static constexpr lsb_t< 16 > lsb16
Definition bin_data.hpp:228
static constexpr msb_t< 16 > msb16
Definition bin_data.hpp:232
bin_stream & operator>>(encode_length< bin_stream > w, std::string &c)
Definition strutils.cpp:159
static constexpr msb_t< 64 > msb64
Definition bin_data.hpp:235
static constexpr lsb_t< 64 > lsb64
Definition bin_data.hpp:231
struct mlab::length_encoded_t length_encoded
std::conditional_t< std::is_enum_v< T >, std::underlying_type_t< T >, T > underlying_t
Definition bin_data.hpp:281
static constexpr bool track_bin_data_mem
Definition bin_data.hpp:27
std::conditional_t< track_bin_data_mem, std::vector< std::uint8_t, tracker_allocator< std::uint8_t > >, std::vector< std::uint8_t > > bin_data_base
Definition bin_data.hpp:125
static constexpr lsb_t< 32 > lsb32
Definition bin_data.hpp:230
static constexpr lsb_t< 24 > lsb24
Definition bin_data.hpp:229
Definition bin_data.hpp:109
const std::uint8_t write_mask
Definition bin_data.hpp:112
std::uint8_t & byte
Definition bin_data.hpp:110
const std::uint8_t index
Definition bin_data.hpp:111
bit_ref & operator=(explicit_bool v)
Definition bin_data.hpp:402
Definition bin_data.hpp:308
T & s
Definition bin_data.hpp:309
Definition bin_data.hpp:98
bool v
Definition bin_data.hpp:99
constexpr explicit_bool(T v_)
Definition bin_data.hpp:102
Definition bin_data.hpp:304
Definition bin_data.hpp:223
Definition bin_data.hpp:226
Definition bin_data.hpp:245
bin_stream & s
Definition bin_data.hpp:246
Definition bin_data.hpp:240
bin_data & bd
Definition bin_data.hpp:241
Definition bin_data.hpp:119
constexpr prealloc(std::size_t size)
Definition bin_data.hpp:120
std::size_t requested_size
Definition bin_data.hpp:122
Definition bin_data.hpp:31
constexpr Iterator begin() const
Definition bin_data.hpp:64
constexpr range(Container &c)
Definition bin_data.hpp:40
constexpr range()=default
Iterator it_end
Definition bin_data.hpp:33
Iterator it_begin
Definition bin_data.hpp:32
constexpr range(range< Jterator > other)
Definition bin_data.hpp:43
constexpr std::iterator_traits< Iterator >::difference_type size() const
Definition bin_data.hpp:46
constexpr std::add_const_t< typename std::iterator_traits< Iterator >::pointer > data() const
Definition bin_data.hpp:53
constexpr std::iterator_traits< Iterator >::pointer data()
Definition bin_data.hpp:60
constexpr Iterator end() const
Definition bin_data.hpp:66
constexpr range(Iterator b, Iterator e)
Definition bin_data.hpp:37
Definition bin_data.hpp:80
static constexpr std::size_t array_size
Definition bin_data.hpp:81
bool operator==(tagged_array const &other) const
Definition bin_data.hpp:343
bool operator!=(tagged_array const &other) const
Definition bin_data.hpp:348