xrpld
Loading...
Searching...
No Matches
aged_associative_container_test.cpp
1#include <xrpl/beast/clock/manual_clock.h>
2#include <xrpl/beast/container/aged_map.h> // IWYU pragma: keep
3#include <xrpl/beast/container/aged_multimap.h> // IWYU pragma: keep
4#include <xrpl/beast/container/aged_multiset.h> // IWYU pragma: keep
5#include <xrpl/beast/container/aged_set.h> // IWYU pragma: keep
6#include <xrpl/beast/container/aged_unordered_map.h> // IWYU pragma: keep
7#include <xrpl/beast/container/aged_unordered_multimap.h> // IWYU pragma: keep
8#include <xrpl/beast/container/aged_unordered_multiset.h> // IWYU pragma: keep
9#include <xrpl/beast/container/aged_unordered_set.h> // IWYU pragma: keep
10#include <xrpl/beast/container/detail/aged_ordered_container.h>
11#include <xrpl/beast/container/detail/aged_unordered_container.h>
12#include <xrpl/beast/unit_test/suite.h>
13
14#include <algorithm>
15#include <chrono>
16#include <cstddef>
17#include <functional>
18#include <memory>
19#include <stdexcept>
20#include <string>
21#include <type_traits> // IWYU pragma: keep
22#include <utility>
23#include <vector> // IWYU pragma: keep
24
25#ifndef BEAST_AGED_UNORDERED_NO_ALLOC_DEFAULTCTOR
26#ifdef _MSC_VER
27#define BEAST_AGED_UNORDERED_NO_ALLOC_DEFAULTCTOR 0
28#else
29#define BEAST_AGED_UNORDERED_NO_ALLOC_DEFAULTCTOR 1
30#endif
31#endif
32
33#ifndef BEAST_CONTAINER_EXTRACT_NOREF
34#ifdef _MSC_VER
35#define BEAST_CONTAINER_EXTRACT_NOREF 1
36#else
37#define BEAST_CONTAINER_EXTRACT_NOREF 1
38#endif
39#endif
40
41namespace beast {
42
44{
45public:
46 template <class T>
47 struct CompT
48 {
49 CompT() = delete;
50
51 explicit CompT(int)
52 {
53 }
54
55 CompT(CompT const&)
56 {
57 }
58
59 bool
60 operator()(T const& lhs, T const& rhs) const
61 {
62 return less_(lhs, rhs);
63 }
64
65 private:
67 };
68
69 template <class T>
70 class HashT
71 {
72 public:
73 HashT() = delete;
74
75 explicit HashT(int)
76 {
77 }
78
80 operator()(T const& t) const
81 {
82 return hash_(t);
83 }
84
85 private:
87 };
88
89 template <class T>
90 struct EqualT
91 {
92 public:
93 EqualT() = delete;
94
95 explicit EqualT(int)
96 {
97 }
98
99 bool
100 operator()(T const& lhs, T const& rhs) const
101 {
102 return eq_(lhs, rhs);
103 }
104
105 private:
107 };
108
109 template <class T>
110 struct AllocT
111 {
112 using value_type = T;
113
114 // using std::true_type::type = propagate_on_container_swap :;
115
116 template <class U>
117 struct Rebind
118 {
120 };
121
122 explicit AllocT(int)
123 {
124 }
125
126 AllocT(AllocT const&) = default;
127
128 template <class U>
130 {
131 }
132
133 template <class U>
134 bool
135 operator==(AllocT<U> const&) const
136 {
137 return true;
138 }
139
140 template <class U>
141 bool
142 operator!=(AllocT<U> const& o) const
143 {
144 return !(*this == o);
145 }
146
147 T*
148 allocate(std::size_t n, T const* = nullptr)
149 {
150 return static_cast<T*>(::operator new(n * sizeof(T)));
151 }
152
153 void
155 {
156 ::operator delete(p);
157 }
158
159#if !BEAST_AGED_UNORDERED_NO_ALLOC_DEFAULTCTOR
161 {
162 }
163#else
164 AllocT() = delete;
165#endif
166 };
167
168 //--------------------------------------------------------------------------
169
170 // ordered
171 template <class Base, bool IsUnordered>
172 class MaybeUnordered : public Base
173 {
174 public:
177
178 protected:
179 static std::string
181 {
182 return "";
183 }
184 };
185
186 // unordered
187 template <class Base>
188 class MaybeUnordered<Base, true> : public Base
189 {
190 public:
195
196 protected:
197 static std::string
199 {
200 return "unordered_";
201 }
202 };
203
204 // unique
205 template <class Base, bool IsMulti>
206 class MaybeMulti : public Base
207 {
208 public:
209 protected:
210 static std::string
212 {
213 return "";
214 }
215 };
216
217 // multi
218 template <class Base>
219 class MaybeMulti<Base, true> : public Base
220 {
221 public:
222 protected:
223 static std::string
225 {
226 return "multi";
227 }
228 };
229
230 // set
231 template <class Base, bool IsMap>
232 class MaybeMap : public Base
233 {
234 public:
235 using T = void;
236 using Value = Base::Key;
238
239 static Base::Key const&
240 extract(Value const& value)
241 {
242 return value; // NOLINT(bugprone-return-const-ref-from-parameter)
243 }
244
245 static Values
247 {
248 Values v{
249 "apple",
250 "banana",
251 "cherry",
252 "grape",
253 "orange",
254 };
255 return v;
256 }
257
258 protected:
259 static std::string
261 {
262 return "set";
263 }
264 };
265
266 // map
267 template <class Base>
268 class MaybeMap<Base, true> : public Base
269 {
270 public:
271 using T = int;
274
275 static Base::Key const&
276 extract(Value const& value)
277 {
278 return value.first;
279 }
280
281 static Values
283 {
284 Values v{
285 std::make_pair("apple", 1),
286 std::make_pair("banana", 2),
287 std::make_pair("cherry", 3),
288 std::make_pair("grape", 4),
289 std::make_pair("orange", 5),
290 };
291 return v;
292 }
293
294 protected:
295 static std::string
297 {
298 return "map";
299 }
300 };
301
302 //--------------------------------------------------------------------------
303
304 // ordered
305 template <class Base, bool IsUnordered = Base::IsUnorderedType::value>
306 struct ContType
307 {
308 template <
309 class Compare = std::less<typename Base::Key>,
310 class Allocator = std::allocator<typename Base::Value>>
312 Base::IsMultiType::value,
313 Base::IsMapType::value,
314 typename Base::Key,
315 typename Base::T,
316 typename Base::Clock,
317 Compare,
318 Allocator>;
319 };
320
321 // unordered
322 template <class Base>
323 struct ContType<Base, true>
324 {
325 template <
327 class KeyEqual = std::equal_to<typename Base::Key>,
328 class Allocator = std::allocator<typename Base::Value>>
330 Base::IsMultiType::value,
331 Base::IsMapType::value,
332 typename Base::Key,
333 typename Base::T,
334 typename Base::Clock,
335 Hash,
336 KeyEqual,
337 Allocator>;
338 };
339
340 //--------------------------------------------------------------------------
341
348
349 template <bool IsUnordered, bool IsMulti, bool IsMap>
351 : MaybeUnordered<MaybeMulti<MaybeMap<TestTraitsBase, IsMap>, IsMulti>, IsUnordered>
352 {
353 private:
354 using Base =
356
357 public:
358 using typename Base::Key;
359
363
366
367 static std::string
369 {
370 return std::string("aged_") + Base::name_ordered_part() + Base::name_multi_part() +
371 Base::name_map_part();
372 }
373 };
374
375 template <bool IsUnordered, bool IsMulti, bool IsMap>
376 struct TestTraits : TestTraitsHelper<IsUnordered, IsMulti, IsMap>,
377 ContType<TestTraitsHelper<IsUnordered, IsMulti, IsMap>>
378 {
379 };
380
381 template <class Cont>
382 static std::string
387
388 template <class Traits>
390 {
391 bool
392 operator()(Traits::Value const& lhs, Traits::Value const& rhs)
393 {
394 return Traits::extract(lhs) == Traits::extract(rhs);
395 }
396 };
397
398 template <class Cont>
400 makeList(Cont const& c)
401 {
402 return std::vector<typename Cont::value_type>(c.begin(), c.end());
403 }
404
405 //--------------------------------------------------------------------------
406
407 template <class Container, class Values>
408 void
409 checkMapContents(Container& c, Values const& v)
410 requires(Container::IsMapType::value && !Container::IsMultiType::value);
411
412 template <class Container, class Values>
413 void
414 checkMapContents(Container, Values const&)
415 requires(!(Container::IsMapType::value && !Container::IsMultiType::value))
416 {
417 }
418
419 // unordered
420 template <class C, class Values>
421 void
422 checkUnorderedContentsRefRef(C&& c, Values const& v)
424
425 template <class C, class Values>
426 void
431
432 template <class C, class Values>
433 void
434 checkContentsRefRef(C&& c, Values const& v);
435
436 template <class Cont, class Values>
437 void
438 checkContents(Cont& c, Values const& v);
439
440 template <class Cont>
441 void
442 checkContents(Cont& c);
443
444 //--------------------------------------------------------------------------
445
446 // ordered
447 template <bool IsUnordered, bool IsMulti, bool IsMap>
448 void
450 requires(!IsUnordered);
451
452 // unordered
453 template <bool IsUnordered, bool IsMulti, bool IsMap>
454 void
456 requires IsUnordered;
457
458 // ordered
459 template <bool IsUnordered, bool IsMulti, bool IsMap>
460 void
462 requires(!IsUnordered);
463
464 // unordered
465 template <bool IsUnordered, bool IsMulti, bool IsMap>
466 void
468 requires IsUnordered;
469
470 // ordered
471 template <bool IsUnordered, bool IsMulti, bool IsMap>
472 void
474 requires(!IsUnordered);
475
476 // unordered
477 template <bool IsUnordered, bool IsMulti, bool IsMap>
478 void
480 requires IsUnordered;
481
482 //--------------------------------------------------------------------------
483
484 template <bool IsUnordered, bool IsMulti, bool IsMap>
485 void
486 testCopyMove();
487
488 //--------------------------------------------------------------------------
489
490 template <bool IsUnordered, bool IsMulti, bool IsMap>
491 void
492 testIterator();
493
494 // Unordered containers don't have reverse iterators
495 template <bool IsUnordered, bool IsMulti, bool IsMap>
496 void
498 requires(!IsUnordered);
499
500 template <bool IsUnordered, bool IsMulti, bool IsMap>
501 void
503 requires IsUnordered
504 {
505 }
506
507 //--------------------------------------------------------------------------
508
509 template <class Container, class Values>
510 void
511 checkInsertCopy(Container& c, Values const& v);
512
513 template <class Container, class Values>
514 void
515 checkInsertMove(Container& c, Values const& v);
516
517 template <class Container, class Values>
518 void
519 checkInsertHintCopy(Container& c, Values const& v);
520
521 template <class Container, class Values>
522 void
523 checkInsertHintMove(Container& c, Values const& v);
524
525 template <class Container, class Values>
526 void
527 checkEmplace(Container& c, Values const& v);
528
529 template <class Container, class Values>
530 void
531 checkEmplaceHint(Container& c, Values const& v);
532
533 template <bool IsUnordered, bool IsMulti, bool IsMap>
534 void
536
537 //--------------------------------------------------------------------------
538
539 template <bool IsUnordered, bool IsMulti, bool IsMap>
540 void
542
543 //--------------------------------------------------------------------------
544
545 // map, unordered_map
546 template <bool IsUnordered, bool IsMulti, bool IsMap>
547 void
549 requires(IsMap && !IsMulti);
550
551 template <bool IsUnordered, bool IsMulti, bool IsMap>
552 void
554 requires(!IsMap || IsMulti)
555 {
556 }
557
558 //--------------------------------------------------------------------------
559
560 // Helpers for erase tests
561 template <class Container, class Values>
562 void
563 reverseFillAgedContainer(Container& c, Values const& v);
564
565 template <class Iter>
566 Iter
567 nextToEndIter(Iter const beginIter, Iter const endItr);
568
569 //--------------------------------------------------------------------------
570
571 template <class Container, class Iter>
572 bool
573 doElementErase(Container& c, Iter const beginItr, Iter const endItr);
574
575 template <bool IsUnordered, bool IsMulti, bool IsMap>
576 void
578
579 //--------------------------------------------------------------------------
580
581 template <class Container, class BeginEndSrc>
582 void
583 doRangeErase(Container& c, BeginEndSrc const& beginEndSrc);
584
585 template <bool IsUnordered, bool IsMulti, bool IsMap>
586 void
588
589 //--------------------------------------------------------------------------
590
591 // ordered
592 template <bool IsUnordered, bool IsMulti, bool IsMap>
593 void
595 requires(!IsUnordered);
596
597 template <bool IsUnordered, bool IsMulti, bool IsMap>
598 void
600 requires IsUnordered
601 {
602 }
603
604 //--------------------------------------------------------------------------
605
606 // ordered
607 template <bool IsUnordered, bool IsMulti, bool IsMap>
608 void
610 requires(!IsUnordered);
611
612 // unordered
613 template <bool IsUnordered, bool IsMulti, bool IsMap>
614 void
616 requires IsUnordered;
617
618 //--------------------------------------------------------------------------
619
620 template <bool IsUnordered, bool IsMulti, bool IsMap>
621 void
623
624 template <bool IsUnordered, bool IsMulti>
625 void
627
628 template <bool IsUnordered>
629 void
631};
632
633//------------------------------------------------------------------------------
634
635// Check contents via at() and operator[]
636// map, unordered_map
637template <class Container, class Values>
638void
640 requires(Container::IsMapType::value && !Container::IsMultiType::value)
641{
642 if (v.empty())
643 {
644 BEAST_EXPECT(c.empty());
645 BEAST_EXPECT(c.size() == 0);
646 return;
647 }
648
649 try
650 {
651 // Make sure no exception is thrown
652 for (auto const& e : v)
653 c.at(e.first);
654 for (auto const& e : v)
655 BEAST_EXPECT(c.operator[](e.first) == e.second);
656 }
657 catch (std::out_of_range const&)
658 {
659 fail("caught exception");
660 }
661}
662
663// unordered
664template <class C, class Values>
665void
668{
669 using Cont = std::remove_reference_t<C>;
670 using Traits =
672 using size_type = Cont::size_type;
673 auto const hash(c.hashFunction());
674 auto const keyEq(c.keyEq());
675 for (size_type i(0); i < c.bucketCount(); ++i)
676 {
677 auto const last(c.end(i));
678 for (auto iter(c.begin(i)); iter != last; ++iter)
679 {
680 auto const match(std::ranges::find_if(v, [iter](Values::value_type const& e) {
681 return Traits::extract(*iter) == Traits::extract(e);
682 }));
683 BEAST_EXPECT(match != v.end());
684 BEAST_EXPECT(keyEq(Traits::extract(*iter), Traits::extract(*match)));
685 BEAST_EXPECT(hash(Traits::extract(*iter)) == hash(Traits::extract(*match)));
686 }
687 }
688}
689
690template <class C, class Values>
691void
693{
694 using Cont = std::remove_reference_t<C>;
695 using size_type = Cont::size_type;
696
697 BEAST_EXPECT(c.size() == v.size());
698 BEAST_EXPECT(size_type(std::distance(c.begin(), c.end())) == v.size());
699 BEAST_EXPECT(size_type(std::distance(c.cbegin(), c.cend())) == v.size());
700 BEAST_EXPECT(
701 size_type(std::distance(c.chronological.begin(), c.chronological.end())) == v.size());
702 BEAST_EXPECT(
703 size_type(std::distance(c.chronological.cbegin(), c.chronological.cend())) == v.size());
704 BEAST_EXPECT(
705 size_type(std::distance(c.chronological.rbegin(), c.chronological.rend())) == v.size());
706 BEAST_EXPECT(
707 size_type(std::distance(c.chronological.crbegin(), c.chronological.crend())) == v.size());
708
710}
711
712template <class Cont, class Values>
713void
715{
717 checkContentsRefRef(const_cast<Cont const&>(c), v);
718 checkMapContents(c, v);
719}
720
721template <class Cont>
722void
730
731//------------------------------------------------------------------------------
732//
733// Construction
734//
735//------------------------------------------------------------------------------
736
737// ordered
738template <bool IsUnordered, bool IsMulti, bool IsMap>
739void
741 requires(!IsUnordered)
742{
744 using Comp = Traits::Comp;
745 using Alloc = Traits::Alloc;
746 using MyComp = Traits::MyComp;
747 using MyAlloc = Traits::MyAlloc;
748 typename Traits::ManualClock clock;
749
750 // testcase (Traits::name() + " empty");
751 testcase("empty");
752
753 {
754 typename Traits::template Cont<Comp, Alloc> c(clock);
755 checkContents(c);
756 }
757
758 {
759 typename Traits::template Cont<MyComp, Alloc> c(clock, MyComp(1));
760 checkContents(c);
761 }
762
763 {
764 typename Traits::template Cont<Comp, MyAlloc> c(clock, MyAlloc(1));
765 checkContents(c);
766 }
767
768 {
769 typename Traits::template Cont<MyComp, MyAlloc> c(clock, MyComp(1), MyAlloc(1));
770 checkContents(c);
771 }
772}
773
774// unordered
775template <bool IsUnordered, bool IsMulti, bool IsMap>
776void
778 requires IsUnordered
779{
780 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
781 using Hash = Traits::Hash;
782 using Equal = Traits::Equal;
783 using Alloc = Traits::Alloc;
784 using MyHash = Traits::MyHash;
785 using MyEqual = Traits::MyEqual;
786 using MyAlloc = Traits::MyAlloc;
787 typename Traits::ManualClock clock;
788
789 // testcase (Traits::name() + " empty");
790 testcase("empty");
791 {
792 typename Traits::template Cont<Hash, Equal, Alloc> c(clock);
793 checkContents(c);
794 }
795
796 {
797 typename Traits::template Cont<MyHash, Equal, Alloc> c(clock, MyHash(1));
798 checkContents(c);
799 }
800
801 {
802 typename Traits::template Cont<Hash, MyEqual, Alloc> c(clock, MyEqual(1));
803 checkContents(c);
804 }
805
806 {
807 typename Traits::template Cont<Hash, Equal, MyAlloc> c(clock, MyAlloc(1));
808 checkContents(c);
809 }
810
811 {
812 typename Traits::template Cont<MyHash, MyEqual, Alloc> c(clock, MyHash(1), MyEqual(1));
813 checkContents(c);
814 }
815
816 {
817 typename Traits::template Cont<MyHash, Equal, MyAlloc> c(clock, MyHash(1), MyAlloc(1));
818 checkContents(c);
819 }
820
821 {
822 typename Traits::template Cont<Hash, MyEqual, MyAlloc> c(clock, MyEqual(1), MyAlloc(1));
823 checkContents(c);
824 }
825
826 {
827 typename Traits::template Cont<MyHash, MyEqual, MyAlloc> c(
828 clock, MyHash(1), MyEqual(1), MyAlloc(1));
829 checkContents(c);
830 }
831}
832
833// ordered
834template <bool IsUnordered, bool IsMulti, bool IsMap>
835void
837 requires(!IsUnordered)
838{
840 using Comp = Traits::Comp;
841 using Alloc = Traits::Alloc;
842 using MyComp = Traits::MyComp;
843 using MyAlloc = Traits::MyAlloc;
844 typename Traits::ManualClock clock;
845 auto const v(Traits::values());
846
847 // testcase (Traits::name() + " range");
848 testcase("range");
849
850 {
851 typename Traits::template Cont<Comp, Alloc> c(v.begin(), v.end(), clock);
852 checkContents(c, v);
853 }
854
855 {
856 typename Traits::template Cont<MyComp, Alloc> c(v.begin(), v.end(), clock, MyComp(1));
857 checkContents(c, v);
858 }
859
860 {
861 typename Traits::template Cont<Comp, MyAlloc> c(v.begin(), v.end(), clock, MyAlloc(1));
862 checkContents(c, v);
863 }
864
865 {
866 typename Traits::template Cont<MyComp, MyAlloc> c(
867 v.begin(), v.end(), clock, MyComp(1), MyAlloc(1));
868 checkContents(c, v);
869 }
870
871 // swap
872
873 {
874 typename Traits::template Cont<Comp, Alloc> c1(v.begin(), v.end(), clock);
875 typename Traits::template Cont<Comp, Alloc> c2(clock);
876 std::swap(c1, c2);
877 checkContents(c2, v);
878 }
879}
880
881// unordered
882template <bool IsUnordered, bool IsMulti, bool IsMap>
883void
885 requires IsUnordered
886{
887 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
888 using Hash = Traits::Hash;
889 using Equal = Traits::Equal;
890 using Alloc = Traits::Alloc;
891 using MyHash = Traits::MyHash;
892 using MyEqual = Traits::MyEqual;
893 using MyAlloc = Traits::MyAlloc;
894 typename Traits::ManualClock clock;
895 auto const v(Traits::values());
896
897 // testcase (Traits::name() + " range");
898 testcase("range");
899
900 {
901 typename Traits::template Cont<Hash, Equal, Alloc> c(v.begin(), v.end(), clock);
902 checkContents(c, v);
903 }
904
905 {
906 typename Traits::template Cont<MyHash, Equal, Alloc> c(
907 v.begin(), v.end(), clock, MyHash(1));
908 checkContents(c, v);
909 }
910
911 {
912 typename Traits::template Cont<Hash, MyEqual, Alloc> c(
913 v.begin(), v.end(), clock, MyEqual(1));
914 checkContents(c, v);
915 }
916
917 {
918 typename Traits::template Cont<Hash, Equal, MyAlloc> c(
919 v.begin(), v.end(), clock, MyAlloc(1));
920 checkContents(c, v);
921 }
922
923 {
924 typename Traits::template Cont<MyHash, MyEqual, Alloc> c(
925 v.begin(), v.end(), clock, MyHash(1), MyEqual(1));
926 checkContents(c, v);
927 }
928
929 {
930 typename Traits::template Cont<MyHash, Equal, MyAlloc> c(
931 v.begin(), v.end(), clock, MyHash(1), MyAlloc(1));
932 checkContents(c, v);
933 }
934
935 {
936 typename Traits::template Cont<Hash, MyEqual, MyAlloc> c(
937 v.begin(), v.end(), clock, MyEqual(1), MyAlloc(1));
938 checkContents(c, v);
939 }
940
941 {
942 typename Traits::template Cont<MyHash, MyEqual, MyAlloc> c(
943 v.begin(), v.end(), clock, MyHash(1), MyEqual(1), MyAlloc(1));
944 checkContents(c, v);
945 }
946}
947
948// ordered
949template <bool IsUnordered, bool IsMulti, bool IsMap>
950void
952 requires(!IsUnordered)
953{
955 typename Traits::ManualClock const clock;
956
957 // testcase (Traits::name() + " init-list");
958 testcase("init-list");
959
960 // VFALCO TODO
961
962 pass();
963}
964
965// unordered
966template <bool IsUnordered, bool IsMulti, bool IsMap>
967void
969 requires IsUnordered
970{
971 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
972 typename Traits::ManualClock const clock;
973
974 // testcase (Traits::name() + " init-list");
975 testcase("init-list");
976
977 // VFALCO TODO
978 pass();
979}
980
981//------------------------------------------------------------------------------
982//
983// Copy/Move construction and assign
984//
985//------------------------------------------------------------------------------
986
987template <bool IsUnordered, bool IsMulti, bool IsMap>
988void
990{
992 using Alloc = Traits::Alloc;
993 typename Traits::ManualClock clock;
994 auto const v(Traits::values());
995
996 // testcase (Traits::name() + " copy/move");
997 testcase("copy/move");
998
999 // copy
1000
1001 {
1002 typename Traits::template Cont<> c(v.begin(), v.end(), clock);
1003 typename Traits::template Cont<> c2(c);
1004 checkContents(c, v);
1005 checkContents(c2, v);
1006 BEAST_EXPECT(c == c2);
1007 unexpected(c != c2);
1008 }
1009
1010 {
1011 typename Traits::template Cont<> c(v.begin(), v.end(), clock);
1012 typename Traits::template Cont<> c2(c, Alloc());
1013 checkContents(c, v);
1014 checkContents(c2, v);
1015 BEAST_EXPECT(c == c2);
1016 unexpected(c != c2);
1017 }
1018
1019 {
1020 typename Traits::template Cont<> c(v.begin(), v.end(), clock);
1021 typename Traits::template Cont<> c2(clock);
1022 c2 = c;
1023 checkContents(c, v);
1024 checkContents(c2, v);
1025 BEAST_EXPECT(c == c2);
1026 unexpected(c != c2);
1027 }
1028
1029 // move
1030
1031 {
1032 typename Traits::template Cont<> c(v.begin(), v.end(), clock);
1033 typename Traits::template Cont<> c2(std::move(c));
1034 checkContents(c2, v);
1035 }
1036
1037 {
1038 typename Traits::template Cont<> c(v.begin(), v.end(), clock);
1039 typename Traits::template Cont<> c2(std::move(c), Alloc());
1040 checkContents(c2, v);
1041 }
1042
1043 {
1044 typename Traits::template Cont<> c(v.begin(), v.end(), clock);
1045 typename Traits::template Cont<> c2(clock);
1046 c2 = std::move(c);
1047 checkContents(c2, v);
1048 }
1049}
1050
1051//------------------------------------------------------------------------------
1052//
1053// Iterator construction and assignment
1054//
1055//------------------------------------------------------------------------------
1056
1057template <bool IsUnordered, bool IsMulti, bool IsMap>
1058void
1060{
1062 typename Traits::ManualClock clock;
1063 auto const v(Traits::values());
1064
1065 // testcase (Traits::name() + " iterators");
1066 testcase("iterator");
1067
1068 typename Traits::template Cont<> c{clock};
1069
1070 using iterator = decltype(c.begin());
1071 using const_iterator = decltype(c.cbegin());
1072
1073 // Should be able to construct or assign an iterator from an iterator.
1074 iterator const nnIt0{c.begin()};
1075 iterator const nnIt1{nnIt0};
1076 BEAST_EXPECT(nnIt0 == nnIt1);
1077 iterator nnIt2;
1078 nnIt2 = nnIt1;
1079 BEAST_EXPECT(nnIt1 == nnIt2);
1080
1081 // Should be able to construct or assign a const_iterator from a
1082 // const_iterator.
1083 const_iterator const ccIt0{c.cbegin()};
1084 const_iterator const ccIt1{ccIt0};
1085 BEAST_EXPECT(ccIt0 == ccIt1);
1086 const_iterator ccIt2;
1087 ccIt2 = ccIt1;
1088 BEAST_EXPECT(ccIt1 == ccIt2);
1089
1090 // Comparison between iterator and const_iterator is okay
1091 BEAST_EXPECT(nnIt0 == ccIt0);
1092 BEAST_EXPECT(ccIt1 == nnIt1);
1093
1094 // Should be able to construct a const_iterator from an iterator.
1095 const_iterator const ncIt3{c.begin()};
1096 const_iterator const ncIt4{nnIt0};
1097 BEAST_EXPECT(ncIt3 == ncIt4);
1098 const_iterator ncIt5;
1099 ncIt5 = nnIt2;
1100 BEAST_EXPECT(ncIt5 == ncIt4);
1101
1102 // None of these should compile because they construct or assign to a
1103 // non-const iterator with a const_iterator.
1104
1105 // iterator cnIt_0 {c.cbegin()};
1106
1107 // iterator cnIt_1 {ccIt_0};
1108
1109 // iterator cnIt_2;
1110 // cnIt_2 = ccIt_2;
1111}
1112
1113template <bool IsUnordered, bool IsMulti, bool IsMap>
1114void
1116 requires(!IsUnordered)
1117{
1119 typename Traits::ManualClock clock;
1120 auto const v(Traits::values());
1121
1122 // testcase (Traits::name() + " reverse_iterators");
1123 testcase("reverse_iterator");
1124
1125 typename Traits::template Cont<> c{clock};
1126
1127 using iterator = decltype(c.begin());
1128 using reverse_iterator = decltype(c.rbegin());
1129 using const_reverse_iterator = decltype(c.crbegin());
1130
1131 // Naming decoder ring
1132 // constructed from ------+ +----- constructed type
1133 // /\/\ -- character pairs
1134 // xAyBit
1135 // r (reverse) or f (forward)--^-^
1136 // ^-^------ C (const) or N (non-const)
1137
1138 // Should be able to construct or assign a reverse_iterator from a
1139 // reverse_iterator.
1140 reverse_iterator const rNrNit0{c.rbegin()};
1141 reverse_iterator const rNrNit1{rNrNit0};
1142 BEAST_EXPECT(rNrNit0 == rNrNit1);
1143 reverse_iterator xXrNit2;
1144 xXrNit2 = rNrNit1;
1145 BEAST_EXPECT(rNrNit1 == xXrNit2);
1146
1147 // Should be able to construct or assign a const_reverse_iterator from a
1148 // const_reverse_iterator
1149 const_reverse_iterator const rCrCit0{c.crbegin()};
1150 const_reverse_iterator const rCrCit1{rCrCit0};
1151 BEAST_EXPECT(rCrCit0 == rCrCit1);
1152 const_reverse_iterator xXrCit2;
1153 xXrCit2 = rCrCit1;
1154 BEAST_EXPECT(rCrCit1 == xXrCit2);
1155
1156 // Comparison between reverse_iterator and const_reverse_iterator is okay
1157 BEAST_EXPECT(rNrNit0 == rCrCit0);
1158 BEAST_EXPECT(rCrCit1 == rNrNit1);
1159
1160 // Should be able to construct or assign a const_reverse_iterator from a
1161 // reverse_iterator
1162 const_reverse_iterator const rNrCit0{c.rbegin()};
1163 const_reverse_iterator const rNrCit1{rNrNit0};
1164 BEAST_EXPECT(rNrCit0 == rNrCit1);
1165 xXrCit2 = rNrNit1;
1166 BEAST_EXPECT(rNrCit1 == xXrCit2);
1167
1168 // The standard allows these conversions:
1169 // o reverse_iterator is explicitly constructible from iterator.
1170 // o const_reverse_iterator is explicitly constructible from
1171 // const_iterator.
1172 // Should be able to construct or assign reverse_iterators from
1173 // non-reverse iterators.
1174 reverse_iterator const fNrNit0{c.begin()};
1175 const_reverse_iterator const fNrCit0{c.begin()};
1176 BEAST_EXPECT(fNrNit0 == fNrCit0);
1177 const_reverse_iterator const fCrCit0{c.cbegin()};
1178 BEAST_EXPECT(fNrCit0 == fCrCit0);
1179
1180 // None of these should compile because they construct a non-reverse
1181 // iterator from a reverse_iterator.
1182 // iterator rNfNit_0 {c.rbegin()};
1183 // const_iterator rNfCit_0 {c.rbegin()};
1184 // const_iterator rCfCit_0 {c.crbegin()};
1185
1186 // You should not be able to assign an iterator to a reverse_iterator or
1187 // vise-versa. So the following lines should not compile.
1188 iterator const xXfNit0;
1189 // xXfNit_0 = xXrNit_2;
1190 // xXrNit_2 = xXfNit_0;
1191}
1192
1193//------------------------------------------------------------------------------
1194//
1195// Modifiers
1196//
1197//------------------------------------------------------------------------------
1198
1199template <class Container, class Values>
1200void
1202{
1203 for (auto const& e : v)
1204 c.insert(e);
1205 checkContents(c, v);
1206}
1207
1208template <class Container, class Values>
1209void
1211{
1212 Values v2(v);
1213 for (auto& e : v2)
1214 c.insert(std::move(e));
1215 checkContents(c, v);
1216}
1217
1218template <class Container, class Values>
1219void
1221{
1222 for (auto const& e : v)
1223 c.insert(c.cend(), e);
1224 checkContents(c, v);
1225}
1226
1227template <class Container, class Values>
1228void
1230{
1231 Values v2(v);
1232 for (auto& e : v2)
1233 c.insert(c.cend(), std::move(e));
1234 checkContents(c, v);
1235}
1236
1237template <class Container, class Values>
1238void
1240{
1241 for (auto const& e : v)
1242 c.emplace(e);
1243 checkContents(c, v);
1244}
1245
1246template <class Container, class Values>
1247void
1249{
1250 for (auto const& e : v)
1251 c.emplace_hint(c.cend(), e);
1252 checkContents(c, v);
1253}
1254
1255template <bool IsUnordered, bool IsMulti, bool IsMap>
1256void
1258{
1260 typename Traits::ManualClock clock;
1261 auto const v(Traits::values());
1262 auto const l(makeList(v));
1263
1264 // testcase (Traits::name() + " modify");
1265 testcase("modify");
1266
1267 {
1268 typename Traits::template Cont<> c(clock);
1269 checkInsertCopy(c, v);
1270 }
1271
1272 {
1273 typename Traits::template Cont<> c(clock);
1274 checkInsertCopy(c, l);
1275 }
1276
1277 {
1278 typename Traits::template Cont<> c(clock);
1279 checkInsertMove(c, v);
1280 }
1281
1282 {
1283 typename Traits::template Cont<> c(clock);
1284 checkInsertMove(c, l);
1285 }
1286
1287 {
1288 typename Traits::template Cont<> c(clock);
1289 checkInsertHintCopy(c, v);
1290 }
1291
1292 {
1293 typename Traits::template Cont<> c(clock);
1294 checkInsertHintCopy(c, l);
1295 }
1296
1297 {
1298 typename Traits::template Cont<> c(clock);
1299 checkInsertHintMove(c, v);
1300 }
1301
1302 {
1303 typename Traits::template Cont<> c(clock);
1304 checkInsertHintMove(c, l);
1305 }
1306}
1307
1308//------------------------------------------------------------------------------
1309//
1310// Chronological ordering
1311//
1312//------------------------------------------------------------------------------
1313
1314template <bool IsUnordered, bool IsMulti, bool IsMap>
1315void
1317{
1319 typename Traits::ManualClock clock;
1320 auto const v(Traits::values());
1321
1322 // testcase (Traits::name() + " chronological");
1323 testcase("chronological");
1324
1325 typename Traits::template Cont<> c(v.begin(), v.end(), clock);
1326
1327 BEAST_EXPECT(std::ranges::equal(c.chronological, v, EqualValue<Traits>()));
1328
1329 // Test touch() with a non-const iterator.
1330 for (auto iter(v.crbegin()); iter != v.crend(); ++iter)
1331 {
1332 using iterator = decltype(c)::iterator;
1333 iterator const found(c.find(Traits::extract(*iter)));
1334
1335 BEAST_EXPECT(found != c.cend());
1336 if (found == c.cend())
1337 return;
1338 c.touch(found);
1339 }
1340
1341 BEAST_EXPECT(
1342 std::equal(
1343 c.chronological.cbegin(),
1344 c.chronological.cend(),
1345 v.crbegin(),
1346 v.crend(),
1348
1349 // Test touch() with a const_iterator
1350 for (auto iter(v.cbegin()); iter != v.cend(); ++iter)
1351 {
1352 using const_iterator = decltype(c)::const_iterator;
1353 const_iterator const found(c.find(Traits::extract(*iter)));
1354
1355 BEAST_EXPECT(found != c.cend());
1356 if (found == c.cend())
1357 return;
1358 c.touch(found);
1359 }
1360
1361 BEAST_EXPECT(std::ranges::equal(c.chronological, v, EqualValue<Traits>()));
1362
1363 {
1364 // Because touch (reverse_iterator pos) is not allowed, the following
1365 // lines should not compile for any aged container type.
1366 // c.touch (c.rbegin());
1367 // c.touch (c.crbegin());
1368 }
1369}
1370
1371//------------------------------------------------------------------------------
1372//
1373// Element creation via operator[]
1374//
1375//------------------------------------------------------------------------------
1376
1377// map, unordered_map
1378template <bool IsUnordered, bool IsMulti, bool IsMap>
1379void
1381 requires(IsMap && !IsMulti)
1382{
1384 typename Traits::ManualClock clock;
1385 auto const v(Traits::values());
1386
1387 // testcase (Traits::name() + " array create");
1388 testcase("array create");
1389
1390 {
1391 // Copy construct key
1392 typename Traits::template Cont<> c(clock);
1393 for (auto const& e : v)
1394 c[e.first] = e.second;
1395 checkContents(c, v);
1396 }
1397
1398 {
1399 // Move construct key
1400 typename Traits::template Cont<> c(clock);
1401 for (auto e : v)
1402 c[std::move(e.first)] = e.second;
1403 checkContents(c, v);
1404 }
1405}
1406
1407//------------------------------------------------------------------------------
1408//
1409// Helpers for erase tests
1410//
1411//------------------------------------------------------------------------------
1412
1413template <class Container, class Values>
1414void
1416{
1417 // Just in case the passed in container was not empty.
1418 c.clear();
1419
1420 // c.clock() returns an abstract_clock, so dynamic_cast to ManualClock.
1421 // VFALCO NOTE This is sketchy
1423 auto& clk = dynamic_cast<ManualClock&>(c.clock());
1424 clk.set(0);
1425
1426 Values rev(values);
1427 std::ranges::sort(rev);
1429 for (auto const& v : rev)
1430 {
1431 // Add values in reverse order so they are reversed chronologically.
1432 ++clk;
1433 c.insert(v);
1434 }
1435}
1436
1437// Get one iterator before endIter. We have to use operator++ because you
1438// cannot use operator-- with unordered container iterators.
1439template <class Iter>
1440Iter
1441AgedAssociativeContainerTestBase::nextToEndIter(Iter beginIter, Iter const endIter)
1442{
1443 if (beginIter == endIter)
1444 {
1445 fail("Internal test failure. Cannot advance beginIter");
1446 return beginIter;
1447 }
1448
1449 //
1450 Iter nextToEnd = beginIter;
1451 do
1452 {
1453 nextToEnd = beginIter++;
1454 } while (beginIter != endIter);
1455 return nextToEnd;
1456}
1457
1458// Implementation for the element erase tests
1459//
1460// This test accepts:
1461// o the container from which we will erase elements
1462// o iterators into that container defining the range of the erase
1463//
1464// This implementation does not declare a pass, since it wants to allow
1465// the caller to examine the size of the container and the returned iterator
1466//
1467// Note that this test works on the aged associative containers because an
1468// erase only invalidates references and iterators to the erased element
1469// (see 23.2.4/13). Therefore the passed-in end iterator stays valid through
1470// the whole test.
1471template <class Container, class Iter>
1472bool
1474 Container& c,
1475 Iter const beginItr,
1476 Iter const endItr)
1477{
1478 auto it(beginItr);
1479 size_t count = c.size();
1480 while (it != endItr)
1481 {
1482 auto expectIt = it;
1483 ++expectIt;
1484 it = c.erase(it);
1485
1486 if (it != expectIt)
1487 {
1488 fail("Unexpected returned iterator from element erase");
1489 return false;
1490 }
1491
1492 --count;
1493 if (count != c.size())
1494 {
1495 fail("Failed to erase element");
1496 return false;
1497 }
1498
1499 if (c.empty())
1500 {
1501 if (it != endItr)
1502 {
1503 fail("Erase of last element didn't produce end");
1504 return false;
1505 }
1506 }
1507 }
1508 return true;
1509}
1510
1511//------------------------------------------------------------------------------
1512//
1513// Erase of individual elements
1514//
1515//------------------------------------------------------------------------------
1516
1517template <bool IsUnordered, bool IsMulti, bool IsMap>
1518void
1520{
1522
1523 // testcase (Traits::name() + " element erase"
1524 testcase("element erase");
1525
1526 // Make and fill the container
1527 typename Traits::ManualClock clock;
1528 typename Traits::template Cont<> c{clock};
1529 reverseFillAgedContainer(c, Traits::values());
1530
1531 {
1532 // Test standard iterators
1533 auto tempContainer(c);
1534 if (!doElementErase(tempContainer, tempContainer.cbegin(), tempContainer.cend()))
1535 return; // Test failed
1536
1537 BEAST_EXPECT(tempContainer.empty());
1538 pass();
1539 }
1540 {
1541 // Test chronological iterators
1542 auto tempContainer(c);
1543 auto& chron(tempContainer.chronological);
1544 if (!doElementErase(tempContainer, chron.begin(), chron.end()))
1545 return; // Test failed
1546
1547 BEAST_EXPECT(tempContainer.empty());
1548 pass();
1549 }
1550 {
1551 // Test standard iterator partial erase
1552 auto tempContainer(c);
1553 BEAST_EXPECT(tempContainer.size() > 2);
1554 if (!doElementErase(
1555 tempContainer,
1556 ++tempContainer.begin(),
1557 nextToEndIter(tempContainer.begin(), tempContainer.end())))
1558 return; // Test failed
1559
1560 BEAST_EXPECT(tempContainer.size() == 2);
1561 pass();
1562 }
1563 {
1564 // Test chronological iterator partial erase
1565 auto tempContainer(c);
1566 BEAST_EXPECT(tempContainer.size() > 2);
1567 auto& chron(tempContainer.chronological);
1568 if (!doElementErase(
1569 tempContainer, ++chron.begin(), nextToEndIter(chron.begin(), chron.end())))
1570 return; // Test failed
1571
1572 BEAST_EXPECT(tempContainer.size() == 2);
1573 pass();
1574 }
1575 {
1576 auto const tempContainer(c);
1577 BEAST_EXPECT(tempContainer.size() > 4);
1578 // erase(reverse_iterator) is not allowed. None of the following
1579 // should compile for any aged container type.
1580 // c.erase (c.rbegin());
1581 // c.erase (c.crbegin());
1582 // c.erase(c.rbegin(), ++c.rbegin());
1583 // c.erase(c.crbegin(), ++c.crbegin());
1584 }
1585}
1586
1587// Implementation for the range erase tests
1588//
1589// This test accepts:
1590//
1591// o A container with more than 2 elements and
1592// o An object to ask for begin() and end() iterators in the passed container
1593//
1594// This peculiar interface allows either the container itself to be passed as
1595// the second argument or the container's "chronological" element. Both
1596// sources of iterators need to be tested on the container.
1597//
1598// The test locates iterators such that a range-based delete leaves the first
1599// and last elements in the container. It then validates that the container
1600// ended up with the expected contents.
1601//
1602template <class Container, class BeginEndSrc>
1603void
1604AgedAssociativeContainerTestBase::doRangeErase(Container& c, BeginEndSrc const& beginEndSrc)
1605{
1606 BEAST_EXPECT(c.size() > 2);
1607 auto itBeginPlusOne(beginEndSrc.begin());
1608 auto const valueFront = *itBeginPlusOne;
1609 ++itBeginPlusOne;
1610
1611 // Get one iterator before end()
1612 auto const itBack(nextToEndIter(itBeginPlusOne, beginEndSrc.end()));
1613 auto const valueBack = *itBack;
1614
1615 // Erase all elements but first and last
1616 auto const retIter = c.erase(itBeginPlusOne, itBack);
1617
1618 BEAST_EXPECT(c.size() == 2);
1619 BEAST_EXPECT(valueFront == *(beginEndSrc.begin()));
1620 BEAST_EXPECT(valueBack == *(++beginEndSrc.begin()));
1621 BEAST_EXPECT(retIter == (++beginEndSrc.begin()));
1622}
1623
1624//------------------------------------------------------------------------------
1625//
1626// Erase range of elements
1627//
1628//------------------------------------------------------------------------------
1629
1630template <bool IsUnordered, bool IsMulti, bool IsMap>
1631void
1633{
1635
1636 // testcase (Traits::name() + " element erase"
1637 testcase("range erase");
1638
1639 // Make and fill the container
1640 typename Traits::ManualClock clock;
1641 typename Traits::template Cont<> c{clock};
1642 reverseFillAgedContainer(c, Traits::values());
1643
1644 // Not bothering to test range erase with reverse iterators.
1645 {
1646 auto tempContainer(c);
1647 doRangeErase(tempContainer, tempContainer);
1648 }
1649 {
1650 auto tempContainer(c);
1651 doRangeErase(tempContainer, tempContainer.chronological);
1652 }
1653}
1654
1655//------------------------------------------------------------------------------
1656//
1657// Container-wide comparison
1658//
1659//------------------------------------------------------------------------------
1660
1661// ordered
1662template <bool IsUnordered, bool IsMulti, bool IsMap>
1663void
1665 requires(!IsUnordered)
1666{
1668 typename Traits::ManualClock clock;
1669 auto const v(Traits::values());
1670
1671 // testcase (Traits::name() + " array create");
1672 testcase("array create");
1673
1674 typename Traits::template Cont<> const c1(v.begin(), v.end(), clock);
1675
1676 typename Traits::template Cont<> c2(v.begin(), v.end(), clock);
1677 c2.erase(c2.cbegin());
1678
1679 expect(c1 != c2);
1680 unexpected(c1 == c2);
1681 expect(c1 < c2);
1682 expect(c1 <= c2);
1683 unexpected(c1 > c2);
1684 unexpected(c1 >= c2);
1685}
1686
1687//------------------------------------------------------------------------------
1688//
1689// Observers
1690//
1691//------------------------------------------------------------------------------
1692
1693// ordered
1694template <bool IsUnordered, bool IsMulti, bool IsMap>
1695void
1697 requires(!IsUnordered)
1698{
1700 typename Traits::ManualClock clock;
1701
1702 // testcase (Traits::name() + " observers");
1703 testcase("observers");
1704
1705 typename Traits::template Cont<> const c(clock);
1706 c.keyComp();
1707 c.valueComp();
1708
1709 pass();
1710}
1711
1712// unordered
1713template <bool IsUnordered, bool IsMulti, bool IsMap>
1714void
1716 requires IsUnordered
1717{
1718 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
1719 typename Traits::ManualClock clock;
1720
1721 // testcase (Traits::name() + " observers");
1722 testcase("observers");
1723
1724 typename Traits::template Cont<> const c(clock);
1725 c.hashFunction();
1726 c.keyEq();
1727
1728 pass();
1729}
1730
1731//------------------------------------------------------------------------------
1732//
1733// Matrix
1734//
1735//------------------------------------------------------------------------------
1736
1737template <bool IsUnordered, bool IsMulti, bool IsMap>
1738void
1755
1756//------------------------------------------------------------------------------
1757
1759{
1760public:
1761 // Compile time checks
1762
1764 using T = int;
1765
1766 static_assert(
1768 "bad alias: AgedSet");
1769
1770 static_assert(
1772 "bad alias: AgedMultiset");
1773
1774 static_assert(
1776 "bad alias: AgedMap");
1777
1778 static_assert(
1780 "bad alias: AgedMultimap");
1781
1782 static_assert(
1786 "bad alias: AgedUnorderedSet");
1787
1788 static_assert(
1792 "bad alias: AgedUnorderedMultiset");
1793
1794 static_assert(
1798 "bad alias: AgedUnorderedMap");
1799
1800 static_assert(
1804 "bad alias: AgedUnorderedMultimap");
1805
1806 void
1811};
1812
1814{
1815public:
1816 void
1817 run() override
1818 {
1820 }
1821};
1822
1824{
1825public:
1826 void
1827 run() override
1828 {
1830 }
1831};
1832
1834{
1835public:
1836 void
1837 run() override
1838 {
1840 }
1841};
1842
1844{
1845public:
1846 void
1847 run() override
1848 {
1850 }
1851};
1852
1854{
1855public:
1856 void
1857 run() override
1858 {
1860 }
1861};
1862
1864{
1865public:
1866 void
1867 run() override
1868 {
1870 }
1871};
1872
1874{
1875public:
1876 void
1877 run() override
1878 {
1880 }
1881};
1882
1887BEAST_DEFINE_TESTSUITE(aged_unordered_set, beast, beast);
1888BEAST_DEFINE_TESTSUITE(aged_unordered_map, beast, beast);
1889BEAST_DEFINE_TESTSUITE(aged_unordered_multiset, beast, beast);
1890BEAST_DEFINE_TESTSUITE(aged_unordered_multimap, beast, beast);
1891
1892} // namespace beast
void reverseFillAgedContainer(Container &c, Values const &v)
bool doElementErase(Container &c, Iter const beginItr, Iter const endItr)
void doRangeErase(Container &c, BeginEndSrc const &beginEndSrc)
static std::vector< typename Cont::value_type > makeList(Cont const &c)
Iter nextToEndIter(Iter const beginIter, Iter const endItr)
Manual clock implementation.
void set(time_point const &when)
Set the current time of the manual clock.
void run() override
Runs the suite.
void run() override
Runs the suite.
Associative container where each element is also indexed by time.
Associative container where each element is also indexed by time.
A testsuite class.
Definition suite.h:52
bool unexpected(Condition shouldBeFalse, String const &reason)
DEPRECATED.
Definition suite.h:516
void pass()
Record a successful test condition.
Definition suite.h:532
bool expect(Condition const &shouldBeTrue)
Evaluate a test condition.
Definition suite.h:235
void fail(String const &reason, char const *file, int line)
Record a failure.
Definition suite.h:554
TestcaseT testcase
Memberspace for declaring test cases.
Definition suite.h:155
T distance(T... args)
T equal(T... args)
T find_if(T... args)
T is_same_v
T make_pair(T... args)
detail::AgedUnorderedContainer< true, false, Key, void, Clock, Hash, KeyEqual, Allocator > AgedUnorderedMultiset
BEAST_DEFINE_TESTSUITE(aged_set, beast, beast)
detail::AgedUnorderedContainer< true, true, Key, T, Clock, Hash, KeyEqual, Allocator > AgedUnorderedMultimap
detail::AgedUnorderedContainer< false, false, Key, void, Clock, Hash, KeyEqual, Allocator > AgedUnorderedSet
detail::AgedUnorderedContainer< false, true, Key, T, Clock, Hash, KeyEqual, Allocator > AgedUnorderedMap
T reverse(T... args)
T sort(T... args)
detail::AgedUnorderedContainer< Base::IsMultiType::value, Base::IsMapType::value, typename Base::Key, typename Base::T, typename Base::Clock, Hash, KeyEqual, Allocator > Cont
detail::AgedOrderedContainer< Base::IsMultiType::value, Base::IsMapType::value, typename Base::Key, typename Base::T, typename Base::Clock, Compare, Allocator > Cont
bool operator()(Traits::Value const &lhs, Traits::Value const &rhs)
MaybeUnordered< MaybeMulti< MaybeMap< TestTraitsBase, IsMap >, IsMulti >, IsUnordered > Base
T swap(T... args)