Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
ah-convert.H
Go to the documentation of this file.
1
2/*
3 Aleph_w
4
5 Data structures & Algorithms
6 version 2.0.0b
7 https://github.com/lrleon/Aleph-w
8
9 This file is part of Aleph-w library
10
11 Copyright (c) 2002-2026 Leandro Rabindranath Leon
12
13 Permission is hereby granted, free of charge, to any person obtaining a copy
14 of this software and associated documentation files (the "Software"), to deal
15 in the Software without restriction, including without limitation the rights
16 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17 copies of the Software, and to permit persons to whom the Software is
18 furnished to do so, subject to the following conditions:
19
20 The above copyright notice and this permission notice shall be included in all
21 copies or substantial portions of the Software.
22
23 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29 SOFTWARE.
30*/
31
32
116#ifndef AH_CONVERT_H
117#define AH_CONVERT_H
118
119#include <deque>
120#include <initializer_list>
121#include <set>
122#include <map>
123#include <utility>
124#include <ah-convert-common.H>
125#include <tpl_array.H>
126#include <tpl_dynArray.H>
127#include <tpl_dynDlist.H>
128#include <tpl_dynSetTree.H>
129#include <tpl_dynSetHash.H>
130#include <tpl_dynMapTree.H>
131#include <tpl_dynMapOhash.H>
132
133namespace Aleph
134{
135
147template <class T>
148[[nodiscard]] DynList<T> to_DynList(const Array<T> & a)
149{
150 return a.template maps<T>([] (const auto & item) -> const T & { return item; });
151}
152
167template <class C>
168[[nodiscard]] Array<typename C::Item_Type> to_Array(const C & c)
170{
172 for (auto it = c.get_it(); it.has_curr(); it.next_ne())
173 ret.append(it.get_curr());
174 return ret;
175}
176
180template <class C>
181[[nodiscard]] Array<typename C::Item_Type> to_array(const C & c)
182{
183 return to_Array(c);
184}
185
197template <class T>
199{
200 DynList<T> ret;
201 for (size_t i = 0; i < a.size(); ++i)
202 ret.append(a(i));
203 return ret;
204}
205
217template <class T>
219{
220 DynArray<T> ret;
221 for (auto it = l.get_it(); it.has_curr(); it.next_ne())
222 ret.append(it.get_curr());
223 return ret;
224}
225
226// to_vector() and vector_to_DynList() are in ah-convert-common.H
227
239template <class T>
240[[nodiscard]] Array<T> vector_to_Array(const std::vector<T> & v)
241{
242 Array<T> ret;
243 ret.reserve(v.size());
244 for (const auto & item : v)
245 ret.append(item);
246 return ret;
247}
248
249// vector_to_DynArray() is in ah-convert-common.H
250
264template <class C>
266{
268 for (auto it = c.get_it(); it.has_curr(); it.next_ne())
269 ret.append(it.get_curr());
270 return ret;
271}
272
284template <class T>
285[[nodiscard]] DynArray<T> array_to_DynArray(const Array<T> & a)
286{
287 DynArray<T> ret;
288 for (size_t i = 0; i < a.size(); ++i)
289 ret.append(a(i));
290 return ret;
291}
292
304template <class T>
305[[nodiscard]] Array<T> dynarray_to_Array(const DynArray<T> & a)
306{
307 Array<T> ret;
308 for (size_t i = 0; i < a.size(); ++i)
309 ret.append(a(i));
310 return ret;
311}
312
325template <class C>
326[[nodiscard]] std::deque<typename C::Item_Type> to_deque(const C & c)
327{
328 std::deque<typename C::Item_Type> ret;
329 for (auto it = c.get_it(); it.has_curr(); it.next_ne())
330 ret.push_back(it.get_curr());
331 return ret;
332}
333
345template <class T>
346[[nodiscard]] DynList<T> deque_to_DynList(const std::deque<T> & d)
347{
348 DynList<T> ret;
349 for (const auto & item : d)
350 ret.append(item);
351 return ret;
352}
353
365template <class T>
366[[nodiscard]] Array<T> deque_to_Array(const std::deque<T> & d)
367{
368 Array<T> ret;
369 ret.reserve(d.size());
370 for (const auto & item : d)
371 ret.append(item);
372 return ret;
373}
374
386template <class T>
387[[nodiscard]] DynArray<T> deque_to_DynArray(const std::deque<T> & d)
388{
389 DynArray<T> ret;
390 for (const auto & item : d)
391 ret.append(item);
392 return ret;
393}
394
395// ==================== DynDlist Conversions ====================
396
408template <class T>
410{
411 DynList<T> ret;
412 l.for_each([&ret](const T & item) { ret.append(item); });
413 return ret;
414}
415
427template <class T>
429{
430 DynDlist<T> ret;
431 l.for_each([&ret](const T & item) { ret.append(item); });
432 return ret;
433}
434
446template <class T>
448{
449 DynArray<T> ret;
450 l.for_each([&ret](const T & item) { ret.append(item); });
451 return ret;
452}
453
465template <class T>
467{
468 DynDlist<T> ret;
469 for (size_t i = 0; i < a.size(); ++i)
470 ret.append(a(i));
471 return ret;
472}
473
485template <class T>
486[[nodiscard]] DynDlist<T> vector_to_DynDlist(const std::vector<T> & v)
487{
488 DynDlist<T> ret;
489 for (const auto & item : v)
490 ret.append(item);
491 return ret;
492}
493
494// ==================== Move Semantics Conversions ====================
495
508template <class T>
509[[nodiscard]] DynList<T> vector_to_DynList(std::vector<T> && v)
510{
511 DynList<T> ret;
512 for (auto & item : v)
513 ret.append(std::move(item));
514 return ret;
515}
516
529template <class T>
530[[nodiscard]] Array<T> vector_to_Array(std::vector<T> && v)
531{
532 Array<T> ret;
533 for (auto & item : v)
534 ret.append(std::move(item));
535 return ret;
536}
537
550template <class T>
551[[nodiscard]] DynArray<T> vector_to_DynArray(std::vector<T> && v)
552{
553 DynArray<T> ret;
554 for (auto & item : v)
555 ret.append(std::move(item));
556 return ret;
557}
558
571template <class T>
572[[nodiscard]] DynDlist<T> vector_to_DynDlist(std::vector<T> && v)
573{
574 DynDlist<T> ret;
575 for (auto & item : v)
576 ret.append(std::move(item));
577 return ret;
578}
579
580// ==================== std::set Conversions ====================
581
595template <class T, class Compare, class Alloc>
596[[nodiscard]] DynList<T> set_to_DynList(const std::set<T, Compare, Alloc> & s)
597{
598 DynList<T> ret;
599 for (const auto & item : s)
600 ret.append(item);
601 return ret;
602}
603
617template <class T, class Compare, class Alloc>
618[[nodiscard]] Array<T> set_to_Array(const std::set<T, Compare, Alloc> & s)
619{
620 Array<T> ret;
621 ret.reserve(s.size());
622 for (const auto & item : s)
623 ret.append(item);
624 return ret;
625}
626
640template <class T, class Compare, class Alloc>
641[[nodiscard]] DynArray<T> set_to_DynArray(const std::set<T, Compare, Alloc> & s)
642{
643 DynArray<T> ret;
644 for (const auto & item : s)
645 ret.append(item);
646 return ret;
647}
648
660template <class C>
661[[nodiscard]] std::set<typename C::Item_Type> to_set(const C & c)
662{
663 std::set<typename C::Item_Type> ret;
664 for (auto it = c.get_it(); it.has_curr(); it.next_ne())
665 ret.insert(it.get_curr());
666 return ret;
667}
668
669// ==================== std::map Conversions ====================
670
685template <class K, class V, class Compare, class Alloc>
686[[nodiscard]] DynList<std::pair<K, V>>
687map_to_DynList(const std::map<K, V, Compare, Alloc> & m)
688{
690 for (const auto & [key, value] : m)
691 ret.append(std::make_pair(key, value));
692 return ret;
693}
694
709template <class K, class V, class Compare, class Alloc>
710[[nodiscard]] Array<std::pair<K, V>>
711map_to_Array(const std::map<K, V, Compare, Alloc> & m)
712{
714 ret.reserve(m.size());
715 for (const auto & [key, value] : m)
716 ret.append(std::make_pair(key, value));
717 return ret;
718}
719
734template <class K, class V, class Compare, class Alloc>
735[[nodiscard]] DynList<K> map_keys_to_DynList(const std::map<K, V, Compare, Alloc> & m)
736{
737 DynList<K> ret;
738 for (const auto & [key, value] : m)
739 ret.append(key);
740 return ret;
741}
742
757template <class K, class V, class Compare, class Alloc>
758[[nodiscard]] DynList<V> map_values_to_DynList(const std::map<K, V, Compare, Alloc> & m)
759{
760 DynList<V> ret;
761 for (const auto & [key, value] : m)
762 ret.append(value);
763 return ret;
764}
765
766// ==================== initializer_list Conversions ====================
767
784template <class T>
785[[nodiscard]] DynList<T> init_to_DynList(std::initializer_list<T> il)
786{
787 DynList<T> ret;
788 for (const auto & item : il)
789 ret.append(item);
790 return ret;
791}
792
809template <class T>
810[[nodiscard]] Array<T> init_to_Array(std::initializer_list<T> il)
811{
812 Array<T> ret;
813 for (const auto & item : il)
814 ret.append(item);
815 return ret;
816}
817
834template <class T>
835[[nodiscard]] DynArray<T> init_to_DynArray(std::initializer_list<T> il)
836{
837 DynArray<T> ret;
838 for (const auto & item : il)
839 ret.append(item);
840 return ret;
841}
842
859template <class T>
860[[nodiscard]] DynDlist<T> init_to_DynDlist(std::initializer_list<T> il)
861{
862 DynDlist<T> ret;
863 for (const auto & item : il)
864 ret.append(item);
865 return ret;
866}
867
868// ==================== DynSetTree Conversions ====================
869
883template <typename Key, template <typename, class> class Tree, class Compare>
885{
886 DynList<Key> ret;
887 s.for_each([&ret](const Key & item) { ret.append(item); });
888 return ret;
889}
890
904template <typename Key, template <typename, class> class Tree, class Compare>
906{
907 Array<Key> ret;
908 ret.reserve(s.size());
909 s.for_each([&ret](const Key & item) { ret.append(item); });
910 return ret;
911}
912
926template <typename Key, template <typename, class> class Tree, class Compare>
928{
929 DynArray<Key> ret;
930 s.for_each([&ret](const Key & item) { ret.append(item); });
931 return ret;
932}
933
944template <typename Key, template <typename, class> class Tree, class Compare>
945[[nodiscard]] std::vector<Key> settree_to_vector(const DynSetTree<Key, Tree, Compare> & s)
946{
947 std::vector<Key> ret;
948 ret.reserve(s.size());
949 s.for_each([&ret](const Key & item) { ret.push_back(item); });
950 return ret;
951}
952
963template <typename Key, template <typename, class> class Tree, class Compare>
964[[nodiscard]] std::set<Key> settree_to_stdset(const DynSetTree<Key, Tree, Compare> & s)
965{
966 std::set<Key> ret;
967 s.for_each([&ret](const Key & item) { ret.insert(item); });
968 return ret;
969}
970
982template <class C>
984{
986 for (auto it = c.get_it(); it.has_curr(); it.next_ne())
987 ret.insert(it.get_curr());
988 return ret;
989}
990
999template <class T>
1000[[nodiscard]] DynSetTree<T> vector_to_DynSetTree(const std::vector<T> & v)
1001{
1002 DynSetTree<T> ret;
1003 for (const auto & item : v)
1004 ret.insert(item);
1005 return ret;
1006}
1007
1008// ==================== DynSetHash Conversions ====================
1009
1020template <typename Key, template <typename, class> class HashTable, class Cmp>
1022{
1023 DynList<Key> ret;
1024 s.for_each([&ret](const Key & item) { ret.append(item); });
1025 return ret;
1026}
1027
1038template <typename Key, template <typename, class> class HashTable, class Cmp>
1040{
1041 Array<Key> ret;
1042 ret.reserve(s.size());
1043 s.for_each([&ret](const Key & item) { ret.append(item); });
1044 return ret;
1045}
1046
1057template <typename Key, template <typename, class> class HashTable, class Cmp>
1059{
1060 DynArray<Key> ret;
1061 s.for_each([&ret](const Key & item) { ret.append(item); });
1062 return ret;
1063}
1064
1075template <typename Key, template <typename, class> class HashTable, class Cmp>
1076[[nodiscard]] std::vector<Key> sethash_to_vector(const DynHashTable<Key, HashTable, Cmp> & s)
1077{
1078 std::vector<Key> ret;
1079 ret.reserve(s.size());
1080 s.for_each([&ret](const Key & item) { ret.push_back(item); });
1081 return ret;
1082}
1083
1084// ==================== DynMapTree Conversions ====================
1085
1100template <typename Key, typename Data,
1101 template <typename, class> class Tree, class Compare>
1102[[nodiscard]] DynList<std::pair<Key, Data>>
1104{
1106 m.for_each([&ret](const std::pair<Key, Data> & p) { ret.append(p); });
1107 return ret;
1108}
1109
1121template <typename Key, typename Data,
1122 template <typename, class> class Tree, class Compare>
1123[[nodiscard]] Array<std::pair<Key, Data>>
1125{
1127 ret.reserve(m.size());
1128 m.for_each([&ret](const std::pair<Key, Data> & p) { ret.append(p); });
1129 return ret;
1130}
1131
1143template <typename Key, typename Data,
1144 template <typename, class> class Tree, class Compare>
1145[[nodiscard]] std::map<Key, Data>
1147{
1148 std::map<Key, Data> ret;
1149 m.for_each([&ret](const std::pair<Key, Data> & p) {
1150 ret.emplace(p.first, p.second);
1151 });
1152 return ret;
1153}
1154
1166template <typename Key, typename Data,
1167 template <typename, class> class Tree, class Compare>
1168[[nodiscard]] DynList<Key>
1170{
1171 DynList<Key> ret;
1172 m.for_each([&ret](const std::pair<Key, Data> & p) { ret.append(p.first); });
1173 return ret;
1174}
1175
1187template <typename Key, typename Data,
1188 template <typename, class> class Tree, class Compare>
1189[[nodiscard]] DynList<Data>
1191{
1192 DynList<Data> ret;
1193 m.for_each([&ret](const std::pair<Key, Data> & p) { ret.append(p.second); });
1194 return ret;
1195}
1196
1208template <class K, class V, class Compare, class Alloc>
1209[[nodiscard]] DynMapTree<K, V>
1210stdmap_to_DynMapTree(const std::map<K, V, Compare, Alloc> & m)
1211{
1212 DynMapTree<K, V> ret;
1213 for (const auto & [key, value] : m)
1214 ret.insert(key, value);
1215 return ret;
1216}
1217
1218// ==================== MapOpenHash Conversions ====================
1219
1231template <typename Key, typename Data, class Cmp,
1232 template <typename, class> class HashTable>
1233[[nodiscard]] DynList<std::pair<Key, Data>>
1235{
1237 m.for_each([&ret](const std::pair<Key, Data> & p) { ret.append(p); });
1238 return ret;
1239}
1240
1252template <typename Key, typename Data, class Cmp,
1253 template <typename, class> class HashTable>
1254[[nodiscard]] Array<std::pair<Key, Data>>
1256{
1258 ret.reserve(m.size());
1259 m.for_each([&ret](const std::pair<Key, Data> & p) { ret.append(p); });
1260 return ret;
1261}
1262
1274template <typename Key, typename Data, class Cmp,
1275 template <typename, class> class HashTable>
1276[[nodiscard]] std::map<Key, Data>
1278{
1279 std::map<Key, Data> ret;
1280 m.for_each([&ret](const std::pair<Key, Data> & p) {
1281 ret.emplace(p.first, p.second);
1282 });
1283 return ret;
1284}
1285
1297template <typename Key, typename Data, class Cmp,
1298 template <typename, class> class HashTable>
1299[[nodiscard]] DynList<Key>
1301{
1302 DynList<Key> ret;
1303 m.for_each([&ret](const std::pair<Key, Data> & p) { ret.append(p.first); });
1304 return ret;
1305}
1306
1318template <typename Key, typename Data, class Cmp,
1319 template <typename, class> class HashTable>
1320[[nodiscard]] DynList<Data>
1322{
1323 DynList<Data> ret;
1324 m.for_each([&ret](const std::pair<Key, Data> & p) { ret.append(p.second); });
1325 return ret;
1326}
1327
1328} // end namespace Aleph
1329
1330#endif // AH_CONVERT_H
Conversions between std::vector and Aleph-w containers shared by ah-convert.H and ah-stl-utils....
size_t size_t int32_t value
Definition ca-c-api.h:116
Simple dynamic array with automatic resizing and functional operations.
Definition tpl_array.H:141
constexpr size_t size() const noexcept
Return the number of elements stored in the stack.
Definition tpl_array.H:450
T & append(const T &data)
Append a copy of data
Definition tpl_array.H:331
void reserve(size_t cap)
Reserves cap cells into the array.
Definition tpl_array.H:402
T & insert(const T &item)
Insert a copy of item at the beginning of the array.
size_t size() const noexcept
Return the current dimension of array.
T & append()
Allocate a new entry to the end of array.
void reserve(const size_t l, const size_t r)
Allocate a range of entries.
Dynamic doubly linked list with O(1) size and bidirectional access.
T & append(const T &item)
Append a copied item at the end of the list.
Self-adjusting dynamic hash table.
Doubly-linked list (defined in tpl_dynList.H).
Definition htlist.H:1231
T & append(const T &item)
Definition htlist.H:1362
Generic key-value map implemented on top of a binary search tree.
Pair * insert(const Key &key, const Data &data)
Insert a key-value pair.
Dynamic set backed by balanced binary search trees with automatic memory management.
const size_t & size() const
Returns the cardinality of the set.
Key * insert(const Key &key)
Inserts a key into the dynamic set.
void for_each(Operation &operation) const
Traverse all the container and performs an operation on each element.
Definition ah-dry.H:1475
auto get_it()
Return a properly initialized iterator positioned at the first item on the container.
Definition ah-dry.H:663
constexpr size_t size() const noexcept
Returns the number of entries in the table.
Definition hashDry.H:954
Concept that identifies types that can be converted or used as an Aleph Array.
Main namespace for Aleph-w library functions.
Array< typename C::Item_Type > to_array(const C &c)
Convenience wrapper identical to to_Array (copy contents).
Definition ah-convert.H:181
DynSetTree< T > vector_to_DynSetTree(const std::vector< T > &v)
Convert a std::vector to a DynSetTree.
std::set< Key > settree_to_stdset(const DynSetTree< Key, Tree, Compare > &s)
Convert a DynSetTree to a std::set.
Definition ah-convert.H:964
DynList< T > to_DynList(const Array< T > &a)
Convert an Array to a DynList.
Definition ah-convert.H:148
DynList< K > map_keys_to_DynList(const std::map< K, V, Compare, Alloc > &m)
Extract keys from a std::map to a DynList.
Definition ah-convert.H:735
DynList< V > map_values_to_DynList(const std::map< K, V, Compare, Alloc > &m)
Extract values from a std::map to a DynList.
Definition ah-convert.H:758
DynList< std::pair< K, V > > map_to_DynList(const std::map< K, V, Compare, Alloc > &m)
Convert a std::map to a DynList of pairs.
Definition ah-convert.H:687
DynList< T > dyndlist_to_DynList(const DynDlist< T > &l)
Convert a DynDlist to a DynList.
Definition ah-convert.H:409
DynList< T > dynarray_to_DynList(const DynArray< T > &a)
Convert a DynArray to a DynList.
Definition ah-convert.H:198
DynList< Key > maptree_keys_to_DynList(const DynMapTree< Key, Data, Tree, Compare > &m)
Extract keys from a DynMapTree to a DynList.
DynArray< T > dyndlist_to_DynArray(const DynDlist< T > &l)
Convert a DynDlist to a DynArray.
Definition ah-convert.H:447
Array< std::pair< Key, Data > > maphash_to_Array(const MapOpenHash< Key, Data, Cmp, HashTable > &m)
Convert a MapOpenHash to an Array of pairs.
DynList< std::pair< Key, Data > > maphash_to_DynList(const MapOpenHash< Key, Data, Cmp, HashTable > &m)
Convert a MapOpenHash to a DynList of pairs.
Array< std::pair< Key, Data > > maptree_to_Array(const DynMapTree< Key, Data, Tree, Compare > &m)
Convert a DynMapTree to an Array of pairs.
DynDlist< T > vector_to_DynDlist(const std::vector< T > &v)
Convert a std::vector to a DynDlist.
Definition ah-convert.H:486
Array< T > deque_to_Array(const std::deque< T > &d)
Convert a std::deque to an Array.
Definition ah-convert.H:366
Array< T > init_to_Array(std::initializer_list< T > il)
Convert an initializer_list to an Array.
Definition ah-convert.H:810
std::vector< Key > sethash_to_vector(const DynHashTable< Key, HashTable, Cmp > &s)
Convert a DynHashTable (hash set) to a std::vector.
DynList< std::pair< Key, Data > > maptree_to_DynList(const DynMapTree< Key, Data, Tree, Compare > &m)
Convert a DynMapTree to a DynList of pairs.
std::decay_t< typename HeadC::Item_Type > T
Definition ah-zip.H:152
Array< T > dynarray_to_Array(const DynArray< T > &a)
Convert a DynArray to an Array.
Definition ah-convert.H:305
DynList< Data > maptree_values_to_DynList(const DynMapTree< Key, Data, Tree, Compare > &m)
Extract values from a DynMapTree to a DynList.
DynArray< Key > settree_to_DynArray(const DynSetTree< Key, Tree, Compare > &s)
Convert a DynSetTree to a DynArray.
Definition ah-convert.H:927
std::map< Key, Data > maphash_to_stdmap(const MapOpenHash< Key, Data, Cmp, HashTable > &m)
Convert a MapOpenHash to a std::map.
Array< T > set_to_Array(const std::set< T, Compare, Alloc > &s)
Convert a std::set to an Array.
Definition ah-convert.H:618
DynList< T > vector_to_DynList(const std::vector< T > &v)
Convert a std::vector to a DynList.
DynArray< T > dynlist_to_DynArray(const DynList< T > &l)
Convert a DynList to a DynArray.
Definition ah-convert.H:218
DynArray< T > array_to_DynArray(const Array< T > &a)
Convert an Array to a DynArray.
Definition ah-convert.H:285
DynSetTree< typename C::Item_Type > to_DynSetTree(const C &c)
Convert a container to a DynSetTree (AVL by default).
Definition ah-convert.H:983
@ Tree
Basic arc (in spanning tree).
DynArray< T > deque_to_DynArray(const std::deque< T > &d)
Convert a std::deque to a DynArray.
Definition ah-convert.H:387
std::vector< Key > settree_to_vector(const DynSetTree< Key, Tree, Compare > &s)
Convert a DynSetTree to a std::vector.
Definition ah-convert.H:945
std::set< typename C::Item_Type > to_set(const C &c)
Convert a container to a std::set.
Definition ah-convert.H:661
Array< T > vector_to_Array(const std::vector< T > &v)
Convert a std::vector to an Array.
Definition ah-convert.H:240
DynList< Key > sethash_to_DynList(const DynHashTable< Key, HashTable, Cmp > &s)
Convert a DynHashTable (hash set) to a DynList.
DynDlist< T > dynlist_to_DynDlist(const DynList< T > &l)
Convert a DynList to a DynDlist.
Definition ah-convert.H:428
Array< Key > sethash_to_Array(const DynHashTable< Key, HashTable, Cmp > &s)
Convert a DynHashTable (hash set) to an Array.
DynDlist< T > init_to_DynDlist(std::initializer_list< T > il)
Convert an initializer_list to a DynDlist.
Definition ah-convert.H:860
DynList< Data > maphash_values_to_DynList(const MapOpenHash< Key, Data, Cmp, HashTable > &m)
Extract values from a MapOpenHash to a DynList.
DynList< Key > settree_to_DynList(const DynSetTree< Key, Tree, Compare > &s)
Convert a DynSetTree to a DynList.
Definition ah-convert.H:884
std::map< Key, Data > maptree_to_stdmap(const DynMapTree< Key, Data, Tree, Compare > &m)
Convert a DynMapTree to a std::map.
DynArray< T > vector_to_DynArray(const std::vector< T > &v)
Convert a std::vector to a DynArray.
DynList< T > deque_to_DynList(const std::deque< T > &d)
Convert a std::deque to a DynList.
Definition ah-convert.H:346
Array< std::pair< K, V > > map_to_Array(const std::map< K, V, Compare, Alloc > &m)
Convert a std::map to an Array of pairs.
Definition ah-convert.H:711
DynList< Key > maphash_keys_to_DynList(const MapOpenHash< Key, Data, Cmp, HashTable > &m)
Extract keys from a MapOpenHash to a DynList.
DynList< T > set_to_DynList(const std::set< T, Compare, Alloc > &s)
Convert a std::set to a DynList.
Definition ah-convert.H:596
Array< typename C::Item_Type > to_Array(const C &c)
Convert a container to an Array.
Definition ah-convert.H:168
DynMapTree< K, V > stdmap_to_DynMapTree(const std::map< K, V, Compare, Alloc > &m)
Convert a std::map to a DynMapTree.
DynArray< T > set_to_DynArray(const std::set< T, Compare, Alloc > &s)
Convert a std::set to a DynArray.
Definition ah-convert.H:641
Array< Key > settree_to_Array(const DynSetTree< Key, Tree, Compare > &s)
Convert a DynSetTree to an Array.
Definition ah-convert.H:905
DynArray< Key > sethash_to_DynArray(const DynHashTable< Key, HashTable, Cmp > &s)
Convert a DynHashTable (hash set) to a DynArray.
std::deque< typename C::Item_Type > to_deque(const C &c)
Convert a container to a std::deque.
Definition ah-convert.H:326
DynArray< typename C::Item_Type > to_DynArray(const C &c)
Convert a container to a DynArray.
Definition ah-convert.H:265
DynDlist< T > dynarray_to_DynDlist(const DynArray< T > &a)
Convert a DynArray to a DynDlist.
Definition ah-convert.H:466
DynList< T > init_to_DynList(std::initializer_list< T > il)
Convert an initializer_list to a DynList.
Definition ah-convert.H:785
DynArray< T > init_to_DynArray(std::initializer_list< T > il)
Convert an initializer_list to a DynArray.
Definition ah-convert.H:835
Open addressing hash map for key-value pairs.
FooMap m(5, fst_unit_pair_hash, snd_unit_pair_hash)
Dynamic array container with automatic resizing.
Lazy and scalable dynamic array implementation.
Dynamic doubly linked list implementation.
Dynamic map with open hashing.
Dynamic key-value map based on balanced binary search trees.
Dynamic set implementations based on hash tables.
Dynamic set implementations based on balanced binary search trees.
DynList< int > l