StormByte 3.0.0
C++26 foundation of the StormByte suite
Loading...
Searching...
No Matches
map.hxx
Go to the documentation of this file.
1/*
2 * Copyright (C) 2024-2026 David C. Manuelda (StormBytePP)
3 *
4 * This is the base for StormByte Suite libraries.
5 *
6 * StormByte original source is dual-licensed:
7 *
8 * 1. GNU Lesser General Public License v3.0 (or later)
9 * You may redistribute and/or modify this file under the terms of the
10 * GNU Lesser General Public License as published by the Free Software
11 * Foundation, either version 3 of the License, or (at your option)
12 * any later version.
13 *
14 * 2. Commercial license
15 * Alternatively, this file may be used under the terms of a commercial
16 * license agreement with the copyright holder
17 * (David C. Manuelda <StormByte@gmail.com>).
18 *
19 * Both licenses apply only to original StormByte source in this repository.
20 * They do not cover other StormByte modules or any third-party material
21 * shipped with this repository (including everything under thirdparty/),
22 * which remains under its own license.
23 *
24 * Neither license grants any patent rights. Any patent licenses required
25 * to use this software or third-party components must be obtained separately
26 * from the patent holders.
27 *
28 * StormByte is distributed in the hope that it will be useful,
29 * but WITHOUT ANY WARRANTY; without even the implied warranty of
30 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 * GNU Lesser General Public License for more details.
32 *
33 * You should have received a copy of the GNU Lesser General Public License
34 * version 3 along with StormByte. If not, see
35 * <https://www.gnu.org/licenses/lgpl-3.0.html>.
36 *
37 * SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-StormByte-Commercial
38 */
39
40#pragma once
41
42#include <StormByte/size.hxx>
47
48#include <compare>
49#include <cstddef>
50#include <initializer_list>
51#include <iterator>
52#include <limits>
53#include <map>
54#include <ranges>
55#include <utility>
56
61namespace StormByte {
66 namespace Safe {
76 template<Type::SafeValue K, Type::SafeValue V, class Compare = std::less<K>>
77 requires std::strict_weak_order<Compare, const K&, const K&>
79 private:
80 struct Node;
81
82 public:
83 using key_type = K;
84 using mapped_type = V;
86 using key_compare = Compare;
87 using size_type = Size;
88 using difference_type = std::ptrdiff_t;
90 using const_reference = const value_type&;
91
96 class value_compare {
97 friend class Map;
98
99 public:
106 bool operator()(const value_type& left, const value_type& right) const {
107 return m_compare(left.first, right.first);
108 }
109
110 private:
115 explicit value_compare(Compare compare): m_compare(compare) {}
116
117 Compare m_compare;
118 };
119
127 template<bool IsConst>
128 class BasicIterator final {
129 using NodeType = std::conditional_t<IsConst, const Node, Node>;
130
131 public:
132 using iterator_category = std::bidirectional_iterator_tag;
133 using iterator_concept = std::bidirectional_iterator_tag;
135 using difference_type = std::ptrdiff_t;
136 using reference = std::conditional_t<IsConst, const value_type&, value_type&>;
137 using pointer = std::conditional_t<IsConst, const value_type*, value_type*>;
138 using StormByteSafeCursor = void;
139
143 BasicIterator() noexcept: m_node(nullptr) {}
144
149 template<bool OtherConst>
150 requires IsConst && (!OtherConst)
151 BasicIterator(const BasicIterator<OtherConst>& other) noexcept: m_node(other.m_node) {}
152
157 reference operator*() const noexcept { return m_node->Entry; }
158
163 pointer operator->() const noexcept { return &m_node->Entry; }
164
170
175 BasicIterator operator++(int) noexcept;
176
181 BasicIterator& operator--() noexcept;
182
187 BasicIterator operator--(int) noexcept;
188
194 template<bool OtherConst>
195 bool operator==(const BasicIterator<OtherConst>& other) const noexcept { return m_node == other.m_node; }
196
197 private:
198 friend class Map;
199 template<bool> friend class BasicIterator;
200
205 explicit BasicIterator(NodeType* node) noexcept: m_node(node) {}
206
207 NodeType* m_node;
208 };
209
212 using reverse_iterator = std::reverse_iterator<iterator>;
213 using const_reverse_iterator = std::reverse_iterator<const_iterator>;
217
224 class node_type {
225 public:
229 node_type() noexcept = default;
230
235 node_type(node_type&& other) noexcept: m_node(other.m_node) { other.m_node = nullptr; }
236
242 node_type& operator=(node_type&& other) noexcept {
243 if (this != &other) {
244 reset();
245 m_node = other.m_node;
246 other.m_node = nullptr;
247 }
248 return *this;
249 }
250
254 node_type(const node_type&) = delete;
255
260 node_type& operator=(const node_type&) = delete;
261
265 ~node_type() { reset(); }
266
271 bool empty() const noexcept { return m_node == nullptr; }
272
277 explicit operator bool() const noexcept { return !empty(); }
278
283 const K& key() const { return m_node->Entry.first; }
284
289 V& mapped() { return m_node->Entry.second; }
290
295 const V& mapped() const { return m_node->Entry.second; }
296
301 void swap(node_type& other) noexcept { std::swap(m_node, other.m_node); }
302
303 private:
304 friend class Map;
305
310 explicit node_type(Node* node) noexcept: m_node(node) {}
311
315 void reset() noexcept {
316 if (m_node == nullptr)
317 return;
318 m_node->Entry.~value_type();
319 Heap::Free(m_node);
320 m_node = nullptr;
321 }
322
323 Node* m_node = nullptr;
324 };
325
334
340
346 explicit Map(const Compare& compare);
347
353 Map(const Map& other);
354
360 Map(Map&& other);
361
367 STORMBYTE_FORCE_INLINE explicit Map(const std::map<K, V, Compare>& other): Map(other.key_comp()) {
368 for (const auto& entry : other)
369 insert(value_type(entry.first, entry.second));
370 }
371
377 STORMBYTE_FORCE_INLINE explicit Map(std::map<K, V, Compare>&& other): Map(other.key_comp()) {
378 for (auto& entry : other)
379 insert(value_type(std::move(entry.first), std::move(entry.second)));
380 other.clear();
381 }
382
389 template<std::ranges::input_range R>
390 requires std::convertible_to<std::ranges::range_reference_t<R>, value_type>
391 STORMBYTE_FORCE_INLINE explicit Map(std::from_range_t, R&& range): Map() {
392 insert_range(std::forward<R>(range));
393 }
394
400 Map(std::initializer_list<value_type> values);
401
405 ~Map() noexcept;
406
413 Map& operator=(const Map& other);
414
420 Map& operator=(Map&& other) noexcept;
421
428 STORMBYTE_FORCE_INLINE Map& operator=(const std::map<K, V, Compare>& other) {
429 Map replacement(other);
430 swap(replacement);
431 return *this;
432 }
433
440 STORMBYTE_FORCE_INLINE Map& operator=(std::map<K, V, Compare>&& other) {
441 Map replacement(std::move(other));
442 swap(replacement);
443 return *this;
444 }
445
452 Map& operator=(std::initializer_list<value_type> values);
453
458 key_compare key_comp() const { return m_compare; }
459
464 value_compare value_comp() const { return value_compare(m_compare); }
465
470 iterator begin() noexcept;
471
476 iterator end() noexcept;
477
482 const_iterator begin() const noexcept;
483
488 const_iterator end() const noexcept;
489
494 const_iterator cbegin() const noexcept;
495
500 const_iterator cend() const noexcept;
501
506 reverse_iterator rbegin() noexcept { return reverse_iterator(end()); }
507
512 reverse_iterator rend() noexcept { return reverse_iterator(begin()); }
513
519
525
530 const_reverse_iterator crbegin() const noexcept { return rbegin(); }
531
536 const_reverse_iterator crend() const noexcept { return rend(); }
537
542 bool empty() const noexcept { return m_size == 0; }
543
548 size_type size() const noexcept { return m_size; }
549
554 size_type max_size() const noexcept { return std::numeric_limits<size_type>::max() / sizeof(Node); }
555
559 void clear() noexcept;
560
565 void swap(Map& other) noexcept;
566
574
582
591
600
608 template<class P>
609 requires Type::ConstructibleFrom<typename Map<K, V, Compare>::value_type, P> && (!Type::SameAs<std::remove_cvref_t<P>, typename Map<K, V, Compare>::value_type>)
611
619 template<class InputIt>
620 STORMBYTE_FORCE_INLINE void insert(InputIt first, InputIt last) {
621 for (; first != last; ++first)
622 insert(value_type(*first));
623 }
624
630 void insert(std::initializer_list<value_type> values);
631
638 template<std::ranges::input_range R>
639 requires std::convertible_to<std::ranges::range_reference_t<R>, value_type>
641 for (auto&& entry : range)
642 insert(value_type(std::forward<decltype(entry)>(entry)));
643 }
644
653 template<class... Args>
654 insert_result try_emplace(const K& key, Args&&... args);
655
664 template<class... Args>
665 insert_result try_emplace(K&& key, Args&&... args);
666
676 template<class... Args>
677 iterator try_emplace(const_iterator hint, const K& key, Args&&... args);
678
688 template<class... Args>
689 iterator try_emplace(const_iterator hint, K&& key, Args&&... args);
690
698 template<class... Args>
699 insert_result emplace(Args&&... args);
700
709 template<class... Args>
710 iterator emplace_hint(const_iterator hint, Args&&... args);
711
719 insert_result insert_or_assign(const K& key, const V& value);
720
728 insert_result insert_or_assign(const K& key, V&& value);
729
737 insert_result insert_or_assign(K&& key, const V& value);
738
746 insert_result insert_or_assign(K&& key, V&& value);
747
756 iterator insert_or_assign(const_iterator hint, const K& key, const V& value);
757
766 iterator insert_or_assign(const_iterator hint, const K& key, V&& value);
767
776 iterator insert_or_assign(const_iterator hint, K&& key, const V& value);
777
786 iterator insert_or_assign(const_iterator hint, K&& key, V&& value);
787
793 insert_return_type insert(node_type&& handle);
794
801 iterator insert(const_iterator hint, node_type&& handle);
802
808 node_type extract(const_iterator position);
809
815 node_type extract(const K& key);
816
822 template<class OtherCompare>
824
830 iterator erase(iterator position) noexcept;
831
837 iterator erase(const_iterator position) noexcept;
838
846
852 size_type erase(const K& key) noexcept;
853
859 iterator find(const K& key) noexcept;
860
866 const_iterator find(const K& key) const noexcept;
867
873 bool contains(const K& key) const noexcept;
874
880 size_type count(const K& key) const noexcept;
881
887 iterator lower_bound(const K& key) noexcept;
888
894 const_iterator lower_bound(const K& key) const noexcept;
895
901 iterator upper_bound(const K& key) noexcept;
902
908 const_iterator upper_bound(const K& key) const noexcept;
909
915 equal_range_result equal_range(const K& key) noexcept;
916
922 const_equal_range_result equal_range(const K& key) const noexcept;
923
930 V& operator[](const K& key);
931
938 V& operator[](K&& key);
939
946 V& at(const K& key);
947
954 const V& at(const K& key) const;
955
962
968 STORMBYTE_FORCE_INLINE std::strong_ordering operator<=>(const Map& other) const requires std::three_way_comparable<K> && std::three_way_comparable<V>;
969
975 bool operator<(const Map& other) const requires requires(const K& a, const K& b, const V& c, const V& d) { a < b; c < d; };
976
982 bool operator<=(const Map& other) const requires requires(const K& a, const K& b, const V& c, const V& d) { a < b; c < d; };
983
989 bool operator>(const Map& other) const requires requires(const K& a, const K& b, const V& c, const V& d) { a < b; c < d; };
990
996 bool operator>=(const Map& other) const requires requires(const K& a, const K& b, const V& c, const V& d) { a < b; c < d; };
997
1002 STORMBYTE_FORCE_INLINE explicit operator std::map<K, V, Compare>() const {
1003 std::map<K, V, Compare> exported(m_compare);
1004 for (const value_type& entry : *this)
1005 exported.emplace(entry.first, entry.second);
1006 return exported;
1007 }
1008
1009 private:
1013 struct Node {
1014 value_type Entry;
1015 Node* Parent;
1016 Node* Left;
1017 Node* Right;
1018 bool Red;
1019 };
1020
1027 bool HintMatches(const_iterator hint, const K& key) const noexcept;
1028
1033 void CreateHeader();
1034
1038 void DestroyHeader() noexcept;
1039
1047 template<class... Args>
1048 Node* MakeNode(Args&&... args);
1049
1054 void DestroyNode(Node* node) noexcept;
1055
1060 void DestroyTree(Node* node) noexcept;
1061
1069 Node* Clone(const Node* source, Node* parent);
1070
1076 Node* FindNode(const K& key) const noexcept;
1077
1084 void InsertNode(Node* node, Node* parent, bool left) noexcept;
1085
1090 void Unlink(Node* node) noexcept;
1091
1096 void EraseNode(Node* node) noexcept;
1097
1102 Node* Leftmost() const noexcept;
1103
1108 void RotateLeft(Node* node) noexcept;
1109
1114 void RotateRight(Node* node) noexcept;
1115
1116 key_compare m_compare;
1117 Node* m_header;
1118 size_type m_size;
1119 };
1120
1129 template<Type::SafeValue K, Type::SafeValue V, class Compare>
1130 inline void swap(Map<K, V, Compare>& left, Map<K, V, Compare>& right) noexcept {
1131 left.swap(right);
1132 }
1133 }
1134
1139 namespace Type {
1146 template<SafeValue K, SafeValue V, class Compare>
1147 requires IsSafe<K>::value && IsSafe<V>::value
1148 struct IsSafe<Safe::Map<K, V, Compare>>: std::true_type {};
1149
1156 template<SafeValue K, SafeValue V, class Compare>
1157 requires MaybeSafe<K> || MaybeSafe<V>
1158 struct IsMaybeSafe<Safe::Map<K, V, Compare>>: std::true_type {};
1159
1166 template<SafeValue K, SafeValue V, class Compare>
1167 struct IsSafeValue<Safe::Map<K, V, Compare>>: std::true_type {};
1168 }
1169}
1170
1174
1175#include <StormByte/safe/map.txx>
1177
Bidirectional cursor over Base-owned map nodes.
Definition map.hxx:128
Map::value_type value_type
Entry type.
Definition map.hxx:134
pointer operator->() const noexcept
Access the entry stored in the node.
Definition map.hxx:163
friend class BasicIterator
Definition map.hxx:199
std::bidirectional_iterator_tag iterator_concept
C++20 iterator concept.
Definition map.hxx:133
BasicIterator() noexcept
Construct a singular iterator.
Definition map.hxx:143
std::ptrdiff_t difference_type
Iterator distance type.
Definition map.hxx:135
BasicIterator & operator++() noexcept
Advance to the next ordered entry.
std::conditional_t< IsConst, const value_type &, value_type & > reference
Entry reference.
Definition map.hxx:136
void StormByteSafeCursor
Base cursor mark. Copying the cursor copies one node pointer.
Definition map.hxx:138
friend class Map
Definition map.hxx:198
reference operator*() const noexcept
Return the entry stored in the node.
Definition map.hxx:157
&&!OtherConst BasicIterator(const BasicIterator< OtherConst > &other) noexcept
Convert a mutable iterator to a const iterator.
Definition map.hxx:151
std::conditional_t< IsConst, const value_type *, value_type * > pointer
Entry pointer.
Definition map.hxx:137
std::bidirectional_iterator_tag iterator_category
Iterator category.
Definition map.hxx:132
Owning handle to one extracted Base node.
Definition map.hxx:224
node_type & operator=(node_type &&other) noexcept
Take the node.
Definition map.hxx:242
node_type(const node_type &)=delete
Copying a node handle is not supported.
~node_type()
Destroy the owned node, if any.
Definition map.hxx:265
const K & key() const
Return the owned key.
Definition map.hxx:283
node_type() noexcept=default
Construct an empty handle.
V & mapped()
Return the owned mapped value.
Definition map.hxx:289
node_type & operator=(const node_type &)=delete
Copying a node handle is not supported.
bool empty() const noexcept
Test whether the handle owns a node.
Definition map.hxx:271
const V & mapped() const
Return the owned mapped value.
Definition map.hxx:295
friend class Map
Definition map.hxx:304
void swap(node_type &other) noexcept
Exchange owned nodes.
Definition map.hxx:301
Orders entries by key, using the map comparator.
Definition map.hxx:96
bool operator()(const value_type &left, const value_type &right) const
Compare two entries by key.
Definition map.hxx:106
friend class Map
Definition map.hxx:97
Ordered unique-key map stored on Base's heap.
Definition map.hxx:78
V & operator[](const K &key)
Return the mapped value, inserting a value-initialized one if absent.
key_compare key_comp() const
Definition map.hxx:458
Map(const Map &other)
Copy every node into new Base blocks.
bool operator>=(const Map &other) const
Order maps lexicographically.
iterator insert_or_assign(const_iterator hint, const K &key, V &&value)
Insert or replace the mapped value, using hint when the neighbouring keys confirm it.
Pair< const_iterator, const_iterator > const_equal_range_result
Read-only lower and upper bound.
Definition map.hxx:216
iterator insert_or_assign(const_iterator hint, const K &key, const V &value)
Insert or replace the mapped value, using hint when the neighbouring keys confirm it.
STORMBYTE_FORCE_INLINE Map(const std::map< K, V, Compare > &other)
Copy a caller-owned STL map.
Definition map.hxx:367
insert_result emplace(Args &&... args)
Construct an entry from arguments forwarded to value_type.
insert_result try_emplace(K &&key, Args &&... args)
Construct an entry in a new node if the key is absent.
STORMBYTE_FORCE_INLINE Map(std::map< K, V, Compare > &&other)
Move elements from a caller-owned STL map and leave it empty.
Definition map.hxx:377
iterator erase(iterator position) noexcept
Erase the entry at an iterator.
const_equal_range_result equal_range(const K &key) const noexcept
Return the equal range of a key.
size_type count(const K &key) const noexcept
Return the number of entries with a key.
insert_result try_emplace(const K &key, Args &&... args)
Construct an entry in a new node if the key is absent.
STORMBYTE_FORCE_INLINE Map(std::from_range_t, R &&range)
Copy the entries of range.
Definition map.hxx:391
const_iterator upper_bound(const K &key) const noexcept
Return the first entry greater than a key.
bool operator>(const Map &other) const
Order maps lexicographically.
bool operator<=(const Map &other) const
Order maps lexicographically.
bool contains(const K &key) const noexcept
Test whether a key is present.
iterator insert_or_assign(const_iterator hint, K &&key, const V &value)
Insert or replace the mapped value, using hint when the neighbouring keys confirm it.
iterator erase(const_iterator position) noexcept
Erase the entry at a read-only iterator.
K key_type
Key type.
Definition map.hxx:83
insert_result insert_or_assign(K &&key, const V &value)
Insert or replace the mapped value.
iterator insert(const_iterator hint, node_type &&handle)
Insert an extracted node, using hint when the neighbouring keys confirm it.
insert_return_type insert(node_type &&handle)
Insert an extracted node if its key is absent.
STORMBYTE_FORCE_INLINE void insert_range(R &&range)
Definition map.hxx:640
Pair< iterator, bool > insert_result
Iterator to the entry and whether it was inserted.
Definition map.hxx:214
V & operator[](K &&key)
Return the mapped value, inserting a value-initialized one if absent.
Pair< const K, V > value_type
Entry type. The key is immutable.
Definition map.hxx:85
void merge(Map< K, V, OtherCompare > &source)
Move unique keys from source into this map.
Size size_type
Element count. Size, not std::size_t.
Definition map.hxx:87
const_iterator cbegin() const noexcept
STORMBYTE_FORCE_INLINE Map & operator=(std::map< K, V, Compare > &&other)
Move-assign elements from a caller-owned STL map and leave it empty.
Definition map.hxx:440
equal_range_result equal_range(const K &key) noexcept
Return the equal range of a key.
bool operator==(const Map &other) const
Compare entries in order.
Compare key_compare
Key ordering.
Definition map.hxx:86
reverse_iterator rend() noexcept
Return the reverse end iterator.
Definition map.hxx:512
insert_result insert_or_assign(const K &key, const V &value)
Insert or replace the mapped value.
Map(std::initializer_list< value_type > values)
Insert every entry of an initializer list.
iterator erase(const_iterator first, const_iterator last) noexcept
Erase a half-open range.
BasicIterator< true > const_iterator
Read-only iterator.
Definition map.hxx:211
iterator begin() noexcept
Return a mutable iterator to the first entry.
Pair< iterator, iterator > equal_range_result
Lower and upper bound.
Definition map.hxx:215
V & at(const K &key)
Return the mapped value.
bool operator<(const Map &other) const
Order maps lexicographically.
const_reverse_iterator crbegin() const noexcept
Return a read-only reverse iterator to the last entry.
Definition map.hxx:530
size_type size() const noexcept
Return the entry count.
Definition map.hxx:548
STORMBYTE_FORCE_INLINE std::strong_ordering operator<=>(const Map &other) const
Order maps lexicographically by key, then mapped value.
size_type max_size() const noexcept
Return the largest representable entry count.
Definition map.hxx:554
void insert(std::initializer_list< value_type > values)
Insert every entry of an initializer list.
const_reverse_iterator rend() const noexcept
Return the read-only reverse end iterator.
Definition map.hxx:524
std::reverse_iterator< const_iterator > const_reverse_iterator
Read-only reverse iterator.
Definition map.hxx:213
std::ptrdiff_t difference_type
Iterator distance type.
Definition map.hxx:88
iterator emplace_hint(const_iterator hint, Args &&... args)
Construct an entry from arguments, using hint when the neighbouring keys confirm it.
Map()
Construct an empty map.
const value_type & const_reference
Read-only entry reference.
Definition map.hxx:90
V mapped_type
Mapped type.
Definition map.hxx:84
value_compare value_comp() const
Return an entry comparator that uses the key ordering.
Definition map.hxx:464
const_reverse_iterator rbegin() const noexcept
Return a read-only reverse iterator to the last entry.
Definition map.hxx:518
reverse_iterator rbegin() noexcept
Definition map.hxx:506
const_iterator lower_bound(const K &key) const noexcept
Return the first entry not less than a key.
Map & operator=(std::initializer_list< value_type > values)
Replace the contents with an initializer list.
iterator lower_bound(const K &key) noexcept
Return the first entry not less than a key.
insert_result insert_or_assign(const K &key, V &&value)
Insert or replace the mapped value.
const_iterator find(const K &key) const noexcept
Find an entry.
iterator try_emplace(const_iterator hint, const K &key, Args &&... args)
Construct an entry if the key is absent, using hint when the neighbouring keys confirm it.
iterator find(const K &key) noexcept
Find an entry.
size_type erase(const K &key) noexcept
Erase the entry with a key.
bool empty() const noexcept
Test whether the map has no entries.
Definition map.hxx:542
const V & at(const K &key) const
Return the mapped value.
const_iterator cend() const noexcept
Map(const Compare &compare)
Construct an empty map with a comparator.
iterator try_emplace(const_iterator hint, K &&key, Args &&... args)
Construct an entry if the key is absent, using hint when the neighbouring keys confirm it.
void clear() noexcept
Destroy every node.
value_type & reference
Mutable entry reference.
Definition map.hxx:89
std::reverse_iterator< iterator > reverse_iterator
Mutable reverse iterator.
Definition map.hxx:212
iterator insert_or_assign(const_iterator hint, K &&key, V &&value)
Insert or replace the mapped value, using hint when the neighbouring keys confirm it.
node_type extract(const_iterator position)
Unlink the entry at position and return that node.
BasicIterator< false > iterator
Mutable iterator.
Definition map.hxx:210
iterator upper_bound(const K &key) noexcept
Return the first entry greater than a key.
Map(Map &&other)
Take the tree.
~Map() noexcept
Destroy every node through Base.
insert_result insert(const value_type &entry)
node_type extract(const K &key)
Unlink the entry with key and return that node.
const_reverse_iterator crend() const noexcept
Return the read-only reverse end iterator.
Definition map.hxx:536
insert_result insert_or_assign(K &&key, V &&value)
Insert or replace the mapped value.
std::pair whose members keep their own Safe storage.
Definition pair.hxx:73
Second second
Second value.
Definition pair.hxx:79
First first
First value.
Definition pair.hxx:78
Count of abstract units (uint64_t storage).
Definition size.hxx:107
Type whose == and != both yield something convertible to bool.
Definition comparison.hxx:81
Recognizes a conditional Safe component after stripping cv and references.
Definition safe.hxx:301
Private Base heap used by StormByte::Safe::Shared, StormByte::Safe::Unique and StormByte::Safe::Clona...
void Free(void *pointer) noexcept
Release a block obtained from Allocate.
Owned values that cross a DLL without the caller's CRT.
void swap(Binary &left, Binary &right) noexcept
Exchange two sequences.
Definition binary.hxx:760
Root namespace of the StormByte suite.
Octet count. Defined in byte_size.hxx. Forwarded so Type::Numeral can name it.
STL namespace.
#define STORMBYTE_FORCE_INLINE
Definition platform.h:134
Host-width-stable count (uint64_t), implicit only to std::size_t.
Result of inserting an extracted node.
Definition map.hxx:329
iterator position
Entry, or end when the node was not inserted and is empty.
Definition map.hxx:330
bool inserted
Whether the node was linked.
Definition map.hxx:331
node_type node
Returned node when the key was already present.
Definition map.hxx:332
Recognizes types whose DLL-boundary safety depends on documented provider requirements.
Definition safe.hxx:262
Recognizes collection values with Base-controlled lifetime.
Definition safe.hxx:347
Recognizes Base Safe components, not universal ABI compatibility.
Definition safe.hxx:138
#define STORMBYTE_PUBLIC_TYPE
Definition visibility.h:57
#define STORMBYTE_PUBLIC
Definition visibility.h:52