rippled
aged_ordered_container.h
1 //------------------------------------------------------------------------------
2 /*
3  This file is part of Beast: https://github.com/vinniefalco/Beast
4  Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
5 
6  Permission to use, copy, modify, and/or distribute this software for any
7  purpose with or without fee is hereby granted, provided that the above
8  copyright notice and this permission notice appear in all copies.
9 
10  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18 //==============================================================================
19 
20 #ifndef BEAST_CONTAINER_DETAIL_AGED_ORDERED_CONTAINER_H_INCLUDED
21 #define BEAST_CONTAINER_DETAIL_AGED_ORDERED_CONTAINER_H_INCLUDED
22 
23 #include <ripple/beast/container/detail/aged_container_iterator.h>
24 #include <ripple/beast/container/detail/aged_associative_container.h>
25 #include <ripple/beast/container/detail/empty_base_optimization.h>
26 #include <ripple/beast/container/aged_container.h>
27 #include <ripple/beast/clock/abstract_clock.h>
28 #include <boost/intrusive/list.hpp>
29 #include <boost/intrusive/set.hpp>
30 #include <boost/version.hpp>
31 #include <algorithm>
32 #include <functional>
33 #include <initializer_list>
34 #include <iterator>
35 #include <memory>
36 #include <ripple/beast/cxx17/type_traits.h> // <type_traits>
37 #include <utility>
38 
39 namespace beast {
40 namespace detail {
41 
42 // Traits templates used to discern reverse_iterators, which are disallowed
43 // for mutating operations.
44 template <class It>
47 {
48  explicit is_boost_reverse_iterator() = default;
49 };
50 
51 template <class It>
52 struct is_boost_reverse_iterator<boost::intrusive::reverse_iterator<It>>
54 {
55  explicit is_boost_reverse_iterator() = default;
56 };
57 
74 template <
75  bool IsMulti,
76  bool IsMap,
77  class Key,
78  class T,
79  class Clock = std::chrono::steady_clock,
80  class Compare = std::less <Key>,
81  class Allocator = std::allocator <
82  typename std::conditional <IsMap,
84  Key>::type>
85 >
87 {
88 public:
91  using duration = typename clock_type::duration;
92  using key_type = Key;
93  using mapped_type = T;
94  using value_type = typename std::conditional <
95  IsMap, std::pair <Key const, T>, Key>::type;
98 
99  // Introspection (for unit tests)
103 
104 private:
105  static Key const& extract (value_type const& value)
106  {
108  }
109 
110  // VFALCO TODO hoist to remove template argument dependencies
111  struct element
112  : boost::intrusive::set_base_hook <
113  boost::intrusive::link_mode <
114  boost::intrusive::normal_link>
115  >
116  , boost::intrusive::list_base_hook <
117  boost::intrusive::link_mode <
118  boost::intrusive::normal_link>
119  >
120  {
121  // Stash types here so the iterator doesn't
122  // need to see the container declaration.
123  struct stashed
124  {
125  explicit stashed() = default;
126 
129  };
130 
132  time_point const& when_,
133  value_type const& value_)
134  : value (value_)
135  , when (when_)
136  {
137  }
138 
140  time_point const& when_,
141  value_type&& value_)
142  : value (std::move (value_))
143  , when (when_)
144  {
145  }
146 
147  template <
148  class... Args,
149  class = typename std::enable_if <
151  Args...>::value>::type
152  >
153  element (time_point const& when_, Args&&... args)
154  : value (std::forward <Args> (args)...)
155  , when (when_)
156  {
157  }
158 
161  };
162 
163  // VFALCO TODO This should only be enabled for maps.
166 #ifdef _LIBCPP_VERSION
168 #endif
169  {
170  public:
171 #ifndef _LIBCPP_VERSION
174  using result_type = bool;
175 #endif
176 
177  bool operator() (value_type const& lhs, value_type const& rhs) const
178  {
179  return this->member() (lhs.first, rhs.first);
180  }
181 
183  {
184  }
185 
187  : beast::detail::empty_base_optimization <Compare> (other)
188  {
189  }
190 
191  private:
193 
194  pair_value_compare (Compare const& compare)
195  : beast::detail::empty_base_optimization <Compare> (compare)
196  {
197  }
198  };
199 
200  // Compares value_type against element, used in insert_check
201  // VFALCO TODO hoist to remove template argument dependencies
204 #ifdef _LIBCPP_VERSION
206 #endif
207  {
208  public:
209 #ifndef _LIBCPP_VERSION
210  using first_argument = Key;
212  using result_type = bool;
213 #endif
214 
215  KeyValueCompare () = default;
216 
217  KeyValueCompare (Compare const& compare)
218  : beast::detail::empty_base_optimization <Compare> (compare)
219  {
220  }
221 
222  // VFALCO NOTE WE might want only to enable these overloads
223  // if Compare has is_transparent
224 #if 0
225  template <class K>
226  bool operator() (K const& k, element const& e) const
227  {
228  return this->member() (k, extract (e.value));
229  }
230 
231  template <class K>
232  bool operator() (element const& e, K const& k) const
233  {
234  return this->member() (extract (e.value), k);
235  }
236 #endif
237 
238  bool operator() (Key const& k, element const& e) const
239  {
240  return this->member() (k, extract (e.value));
241  }
242 
243  bool operator() (element const& e, Key const& k) const
244  {
245  return this->member() (extract (e.value), k);
246  }
247 
248  bool operator() (element const& x, element const& y) const
249  {
250  return this->member() (extract (x.value), extract (y.value));
251  }
252 
253  Compare& compare()
254  {
256  }
257 
258  Compare const& compare() const
259  {
261  }
262  };
263 
264  using list_type = typename boost::intrusive::make_list <element,
265  boost::intrusive::constant_time_size <false>>::type;
266 
267  using cont_type = typename std::conditional <
268  IsMulti,
269  typename boost::intrusive::make_multiset <element,
270  boost::intrusive::constant_time_size <true>,
271  boost::intrusive::compare<KeyValueCompare>
272  >::type,
273  typename boost::intrusive::make_set <element,
274  boost::intrusive::constant_time_size <true>,
275  boost::intrusive::compare<KeyValueCompare>
276  >::type
277  >::type;
278 
279  using ElementAllocator = typename std::allocator_traits <
280  Allocator>::template rebind_alloc <element>;
281 
283 
284  class config_t
285  : private KeyValueCompare
286  , public beast::detail::empty_base_optimization <ElementAllocator>
287  {
288  public:
289  explicit config_t (
290  clock_type& clock_)
291  : clock (clock_)
292  {
293  }
294 
296  clock_type& clock_,
297  Compare const& comp)
298  : KeyValueCompare (comp)
299  , clock (clock_)
300  {
301  }
302 
304  clock_type& clock_,
305  Allocator const& alloc_)
306  : beast::detail::empty_base_optimization <ElementAllocator> (alloc_)
307  , clock (clock_)
308  {
309  }
310 
312  clock_type& clock_,
313  Compare const& comp,
314  Allocator const& alloc_)
315  : KeyValueCompare (comp)
316  , beast::detail::empty_base_optimization <ElementAllocator> (alloc_)
317  , clock (clock_)
318  {
319  }
320 
321  config_t (config_t const& other)
322  : KeyValueCompare (other.key_compare())
325  select_on_container_copy_construction (
326  other.alloc()))
327  , clock (other.clock)
328  {
329  }
330 
331  config_t (config_t const& other, Allocator const& alloc)
332  : KeyValueCompare (other.key_compare())
334  , clock (other.clock)
335  {
336  }
337 
338  config_t (config_t&& other)
339  : KeyValueCompare (std::move (other.key_compare()))
341  std::move (other))
342  , clock (other.clock)
343  {
344  }
345 
346  config_t (config_t&& other, Allocator const& alloc)
347  : KeyValueCompare (std::move (other.key_compare()))
349  , clock (other.clock)
350  {
351  }
352 
353  config_t& operator= (config_t const& other)
354  {
355  if (this != &other)
356  {
357  compare() = other.compare();
358  alloc() = other.alloc();
359  clock = other.clock;
360  }
361  return *this;
362  }
363 
365  {
366  compare() = std::move (other.compare());
367  alloc() = std::move (other.alloc());
368  clock = other.clock;
369  return *this;
370  }
371 
372  Compare& compare ()
373  {
374  return KeyValueCompare::compare();
375  }
376 
377  Compare const& compare () const
378  {
379  return KeyValueCompare::compare();
380  }
381 
383  {
384  return *this;
385  }
386 
388  {
389  return *this;
390  }
391 
393  {
396  }
397 
398  ElementAllocator const& alloc() const
399  {
402  }
403 
405  };
406 
407  template <class... Args>
408  element* new_element (Args&&... args)
409  {
410  struct Deleter
411  {
413  Deleter (ElementAllocator& a)
414  : a_(a)
415  {
416  }
417 
418  void
419  operator()(element* p)
420  {
422  }
423  };
424 
426  m_config.alloc(), 1), Deleter(m_config.alloc()));
428  p.get(), clock().now(), std::forward <Args> (args)...);
429  return p.release();
430  }
431 
432  void delete_element (element const* p)
433  {
436  m_config.alloc(), const_cast<element*>(p), 1);
437  }
438 
439  void unlink_and_delete_element (element const* p)
440  {
441  chronological.list.erase (
442  chronological.list.iterator_to (*p));
443  m_cont.erase (m_cont.iterator_to (*p));
444  delete_element (p);
445  }
446 
447 public:
448  using key_compare = Compare;
449  using value_compare = typename std::conditional <
450  IsMap,
451  pair_value_compare,
452  Compare>::type;
453  using allocator_type = Allocator;
455  using const_reference = value_type const&;
456  using pointer = typename std::allocator_traits <
457  Allocator>::pointer;
458  using const_pointer = typename std::allocator_traits <
459  Allocator>::const_pointer;
460 
461  // A set iterator (IsMap==false) is always const
462  // because the elements of a set are immutable.
464  ! IsMap, typename cont_type::iterator>;
466  true, typename cont_type::iterator>;
468  ! IsMap, typename cont_type::reverse_iterator>;
470  true, typename cont_type::reverse_iterator>;
471 
472  //--------------------------------------------------------------------------
473  //
474  // Chronological ordered iterators
475  //
476  // "Memberspace"
477  // http://accu.org/index.php/journals/1527
478  //
479  //--------------------------------------------------------------------------
480 
482  {
483  public:
484  // A set iterator (IsMap==false) is always const
485  // because the elements of a set are immutable.
487  ! IsMap, typename list_type::iterator>;
489  true, typename list_type::iterator>;
491  ! IsMap, typename list_type::reverse_iterator>;
493  true, typename list_type::reverse_iterator>;
494 
496  {
497  return iterator (list.begin());
498  }
499 
501  {
502  return const_iterator (list.begin ());
503  }
504 
506  {
507  return const_iterator (list.begin ());
508  }
509 
511  {
512  return iterator (list.end ());
513  }
514 
516  {
517  return const_iterator (list.end ());
518  }
519 
521  {
522  return const_iterator (list.end ());
523  }
524 
526  {
527  return reverse_iterator (list.rbegin());
528  }
529 
531  {
532  return const_reverse_iterator (list.rbegin ());
533  }
534 
536  {
537  return const_reverse_iterator (list.rbegin ());
538  }
539 
541  {
542  return reverse_iterator (list.rend ());
543  }
544 
546  {
547  return const_reverse_iterator (list.rend ());
548  }
549 
551  {
552  return const_reverse_iterator (list.rend ());
553  }
554 
556  {
558  "must be standard layout");
559  return list.iterator_to (*reinterpret_cast <element*>(
560  reinterpret_cast<uint8_t*>(&value)-((std::size_t)
561  std::addressof(((element*)0)->member))));
562  }
563 
564  const_iterator iterator_to (value_type const& value) const
565  {
567  "must be standard layout");
568  return list.iterator_to (*reinterpret_cast <element const*>(
569  reinterpret_cast<uint8_t const*>(&value)-((std::size_t)
570  std::addressof(((element*)0)->member))));
571  }
572 
573  private:
575  {
576  }
577 
578  chronological_t (chronological_t const&) = delete;
579  chronological_t (chronological_t&&) = delete;
580 
582  list_type mutable list;
583  } chronological;
584 
585  //--------------------------------------------------------------------------
586  //
587  // Construction
588  //
589  //--------------------------------------------------------------------------
590 
591  aged_ordered_container() = delete;
592 
594 
596  Compare const& comp);
597 
599  Allocator const& alloc);
600 
602  Compare const& comp, Allocator const& alloc);
603 
604  template <class InputIt>
605  aged_ordered_container (InputIt first, InputIt last, clock_type& clock);
606 
607  template <class InputIt>
608  aged_ordered_container (InputIt first, InputIt last, clock_type& clock,
609  Compare const& comp);
610 
611  template <class InputIt>
612  aged_ordered_container (InputIt first, InputIt last, clock_type& clock,
613  Allocator const& alloc);
614 
615  template <class InputIt>
616  aged_ordered_container (InputIt first, InputIt last, clock_type& clock,
617  Compare const& comp, Allocator const& alloc);
618 
620 
622  Allocator const& alloc);
623 
625 
627  Allocator const& alloc);
628 
630  clock_type& clock);
631 
633  clock_type& clock, Compare const& comp);
634 
636  clock_type& clock, Allocator const& alloc);
637 
639  clock_type& clock, Compare const& comp, Allocator const& alloc);
640 
642 
644  operator= (aged_ordered_container const& other);
645 
648 
651 
654  {
655  return m_config.alloc();
656  }
657 
658  clock_type&
660  {
661  return m_config.clock;
662  }
663 
664  clock_type const&
665  clock() const
666  {
667  return m_config.clock;
668  }
669 
670  //--------------------------------------------------------------------------
671  //
672  // Element access (maps)
673  //
674  //--------------------------------------------------------------------------
675 
676  template <
677  class K,
678  bool maybe_multi = IsMulti,
679  bool maybe_map = IsMap,
682  at (K const& k);
683 
684  template <
685  class K,
686  bool maybe_multi = IsMulti,
687  bool maybe_map = IsMap,
690  at (K const& k) const;
691 
692  template <
693  bool maybe_multi = IsMulti,
694  bool maybe_map = IsMap,
697  operator[] (Key const& key);
698 
699  template <
700  bool maybe_multi = IsMulti,
701  bool maybe_map = IsMap,
704  operator[] (Key&& key);
705 
706  //--------------------------------------------------------------------------
707  //
708  // Iterators
709  //
710  //--------------------------------------------------------------------------
711 
712  iterator
713  begin ()
714  {
715  return iterator (m_cont.begin());
716  }
717 
719  begin () const
720  {
721  return const_iterator (m_cont.begin ());
722  }
723 
725  cbegin() const
726  {
727  return const_iterator (m_cont.begin ());
728  }
729 
730  iterator
731  end ()
732  {
733  return iterator (m_cont.end ());
734  }
735 
737  end () const
738  {
739  return const_iterator (m_cont.end ());
740  }
741 
743  cend () const
744  {
745  return const_iterator (m_cont.end ());
746  }
747 
750  {
751  return reverse_iterator (m_cont.rbegin());
752  }
753 
755  rbegin () const
756  {
757  return const_reverse_iterator (m_cont.rbegin ());
758  }
759 
761  crbegin() const
762  {
763  return const_reverse_iterator (m_cont.rbegin ());
764  }
765 
767  rend ()
768  {
769  return reverse_iterator (m_cont.rend ());
770  }
771 
773  rend () const
774  {
775  return const_reverse_iterator (m_cont.rend ());
776  }
777 
779  crend () const
780  {
781  return const_reverse_iterator (m_cont.rend ());
782  }
783 
784  iterator
786  {
788  "must be standard layout");
789  return m_cont.iterator_to (*reinterpret_cast <element*>(
790  reinterpret_cast<uint8_t*>(&value)-((std::size_t)
791  std::addressof(((element*)0)->member))));
792  }
793 
795  iterator_to (value_type const& value) const
796  {
798  "must be standard layout");
799  return m_cont.iterator_to (*reinterpret_cast <element const*>(
800  reinterpret_cast<uint8_t const*>(&value)-((std::size_t)
801  std::addressof(((element*)0)->member))));
802  }
803 
804  //--------------------------------------------------------------------------
805  //
806  // Capacity
807  //
808  //--------------------------------------------------------------------------
809 
810  bool
811  empty() const noexcept
812  {
813  return m_cont.empty();
814  }
815 
816  size_type
817  size() const noexcept
818  {
819  return m_cont.size();
820  }
821 
822  size_type
823  max_size() const noexcept
824  {
825  return m_config.max_size();
826  }
827 
828  //--------------------------------------------------------------------------
829  //
830  // Modifiers
831  //
832  //--------------------------------------------------------------------------
833 
834  void
835  clear();
836 
837  // map, set
838  template <bool maybe_multi = IsMulti>
839  auto
840  insert (value_type const& value) ->
841  typename std::enable_if <! maybe_multi,
843 
844  // multimap, multiset
845  template <bool maybe_multi = IsMulti>
846  auto
847  insert (value_type const& value) ->
848  typename std::enable_if <maybe_multi,
849  iterator>::type;
850 
851  // set
852  template <bool maybe_multi = IsMulti, bool maybe_map = IsMap>
853  auto
854  insert (value_type&& value) ->
855  typename std::enable_if <! maybe_multi && ! maybe_map,
857 
858  // multiset
859  template <bool maybe_multi = IsMulti, bool maybe_map = IsMap>
860  auto
861  insert (value_type&& value) ->
862  typename std::enable_if <maybe_multi && ! maybe_map,
863  iterator>::type;
864 
865  //---
866 
867  // map, set
868  template <bool maybe_multi = IsMulti>
869  auto
870  insert (const_iterator hint, value_type const& value) ->
871  typename std::enable_if <! maybe_multi,
872  iterator>::type;
873 
874  // multimap, multiset
875  template <bool maybe_multi = IsMulti>
876  typename std::enable_if <maybe_multi,
877  iterator>::type
878  insert (const_iterator /*hint*/, value_type const& value)
879  {
880  // VFALCO TODO Figure out how to utilize 'hint'
881  return insert (value);
882  }
883 
884  // map, set
885  template <bool maybe_multi = IsMulti>
886  auto
887  insert (const_iterator hint, value_type&& value) ->
888  typename std::enable_if <! maybe_multi,
889  iterator>::type;
890 
891  // multimap, multiset
892  template <bool maybe_multi = IsMulti>
893  typename std::enable_if <maybe_multi,
894  iterator>::type
895  insert (const_iterator /*hint*/, value_type&& value)
896  {
897  // VFALCO TODO Figure out how to utilize 'hint'
898  return insert (std::move (value));
899  }
900 
901  // map, multimap
902  template <
903  class P,
904  bool maybe_map = IsMap
905  >
906  typename std::enable_if <maybe_map &&
908  typename std::conditional <IsMulti,
909  iterator,
911  >::type
912  >::type
913  insert (P&& value)
914  {
915  return emplace (std::forward <P> (value));
916  }
917 
918  // map, multimap
919  template <
920  class P,
921  bool maybe_map = IsMap
922  >
923  typename std::enable_if <maybe_map &&
925  typename std::conditional <IsMulti,
926  iterator,
928  >::type
929  >::type
930  insert (const_iterator hint, P&& value)
931  {
932  return emplace_hint (hint, std::forward <P> (value));
933  }
934 
935  template <class InputIt>
936  void
937  insert (InputIt first, InputIt last)
938  {
939  for (; first != last; ++first)
940  insert (cend(), *first);
941  }
942 
943  void
945  {
946  insert (init.begin(), init.end());
947  }
948 
949  // map, set
950  template <bool maybe_multi = IsMulti, class... Args>
951  auto
952  emplace (Args&&... args) ->
953  typename std::enable_if <! maybe_multi,
955 
956  // multiset, multimap
957  template <bool maybe_multi = IsMulti, class... Args>
958  auto
959  emplace (Args&&... args) ->
960  typename std::enable_if <maybe_multi,
961  iterator>::type;
962 
963  // map, set
964  template <bool maybe_multi = IsMulti, class... Args>
965  auto
966  emplace_hint (const_iterator hint, Args&&... args) ->
967  typename std::enable_if <! maybe_multi,
969 
970  // multiset, multimap
971  template <bool maybe_multi = IsMulti, class... Args>
972  typename std::enable_if <maybe_multi,
973  iterator>::type
974  emplace_hint (const_iterator /*hint*/, Args&&... args)
975  {
976  // VFALCO TODO Figure out how to utilize 'hint'
977  return emplace <maybe_multi> (
978  std::forward <Args> (args)...);
979  }
980 
981  // enable_if prevents erase (reverse_iterator pos) from compiling
982  template <bool is_const, class Iterator, class Base,
986 
987  // enable_if prevents erase (reverse_iterator first, reverse_iterator last)
988  // from compiling
989  template <bool is_const, class Iterator, class Base,
994 
995  template <class K>
996  auto
997  erase (K const& k) ->
998  size_type;
999 
1000  void
1001  swap (aged_ordered_container& other) noexcept;
1002 
1003  //--------------------------------------------------------------------------
1004 
1005  // enable_if prevents touch (reverse_iterator pos) from compiling
1006  template <bool is_const, class Iterator, class Base,
1008  void
1010  {
1011  touch (pos, clock().now());
1012  }
1013 
1014  template <class K>
1015  size_type
1016  touch (K const& k);
1017 
1018  //--------------------------------------------------------------------------
1019  //
1020  // Lookup
1021  //
1022  //--------------------------------------------------------------------------
1023 
1024  // VFALCO TODO Respect is_transparent (c++14)
1025  template <class K>
1026  size_type
1027  count (K const& k) const
1028  {
1029  return m_cont.count (k,
1031  }
1032 
1033  // VFALCO TODO Respect is_transparent (c++14)
1034  template <class K>
1035  iterator
1036  find (K const& k)
1037  {
1038  return iterator (m_cont.find (k,
1040  }
1041 
1042  // VFALCO TODO Respect is_transparent (c++14)
1043  template <class K>
1045  find (K const& k) const
1046  {
1047  return const_iterator (m_cont.find (k,
1049  }
1050 
1051  // VFALCO TODO Respect is_transparent (c++14)
1052  template <class K>
1054  equal_range (K const& k)
1055  {
1056  auto const r (m_cont.equal_range (k,
1058  return std::make_pair (iterator (r.first),
1059  iterator (r.second));
1060  }
1061 
1062  // VFALCO TODO Respect is_transparent (c++14)
1063  template <class K>
1065  equal_range (K const& k) const
1066  {
1067  auto const r (m_cont.equal_range (k,
1069  return std::make_pair (const_iterator (r.first),
1070  const_iterator (r.second));
1071  }
1072 
1073  // VFALCO TODO Respect is_transparent (c++14)
1074  template <class K>
1075  iterator
1076  lower_bound (K const& k)
1077  {
1078  return iterator (m_cont.lower_bound (k,
1080  }
1081 
1082  // VFALCO TODO Respect is_transparent (c++14)
1083  template <class K>
1085  lower_bound (K const& k) const
1086  {
1087  return const_iterator (m_cont.lower_bound (k,
1089  }
1090 
1091  // VFALCO TODO Respect is_transparent (c++14)
1092  template <class K>
1093  iterator
1094  upper_bound (K const& k)
1095  {
1096  return iterator (m_cont.upper_bound (k,
1098  }
1099 
1100  // VFALCO TODO Respect is_transparent (c++14)
1101  template <class K>
1103  upper_bound (K const& k) const
1104  {
1105  return const_iterator (m_cont.upper_bound (k,
1107  }
1108 
1109  //--------------------------------------------------------------------------
1110  //
1111  // Observers
1112  //
1113  //--------------------------------------------------------------------------
1114 
1115  key_compare
1116  key_comp() const
1117  {
1118  return m_config.compare();
1119  }
1120 
1121  // VFALCO TODO Should this return const reference for set?
1123  value_comp() const
1124  {
1125  return value_compare (m_config.compare());
1126  }
1127 
1128  //--------------------------------------------------------------------------
1129  //
1130  // Comparison
1131  //
1132  //--------------------------------------------------------------------------
1133 
1134  // This differs from the standard in that the comparison
1135  // is only done on the key portion of the value type, ignoring
1136  // the mapped type.
1137  //
1138  template <
1139  bool OtherIsMulti,
1140  bool OtherIsMap,
1141  class OtherT,
1142  class OtherDuration,
1143  class OtherAllocator
1144  >
1145  bool
1146  operator== (
1147  aged_ordered_container <OtherIsMulti, OtherIsMap,
1148  Key, OtherT, OtherDuration, Compare,
1149  OtherAllocator> const& other) const;
1150 
1151  template <
1152  bool OtherIsMulti,
1153  bool OtherIsMap,
1154  class OtherT,
1155  class OtherDuration,
1156  class OtherAllocator
1157  >
1158  bool
1160  aged_ordered_container <OtherIsMulti, OtherIsMap,
1161  Key, OtherT, OtherDuration, Compare,
1162  OtherAllocator> const& other) const
1163  {
1164  return ! (this->operator== (other));
1165  }
1166 
1167  template <
1168  bool OtherIsMulti,
1169  bool OtherIsMap,
1170  class OtherT,
1171  class OtherDuration,
1172  class OtherAllocator
1173  >
1174  bool
1176  aged_ordered_container <OtherIsMulti, OtherIsMap,
1177  Key, OtherT, OtherDuration, Compare,
1178  OtherAllocator> const& other) const
1179  {
1180  value_compare const comp (value_comp ());
1182  cbegin(), cend(), other.cbegin(), other.cend(), comp);
1183  }
1184 
1185  template <
1186  bool OtherIsMulti,
1187  bool OtherIsMap,
1188  class OtherT,
1189  class OtherDuration,
1190  class OtherAllocator
1191  >
1192  bool
1194  aged_ordered_container <OtherIsMulti, OtherIsMap,
1195  Key, OtherT, OtherDuration, Compare,
1196  OtherAllocator> const& other) const
1197  {
1198  return ! (other < *this);
1199  }
1200 
1201  template <
1202  bool OtherIsMulti,
1203  bool OtherIsMap,
1204  class OtherT,
1205  class OtherDuration,
1206  class OtherAllocator
1207  >
1208  bool
1210  aged_ordered_container <OtherIsMulti, OtherIsMap,
1211  Key, OtherT, OtherDuration, Compare,
1212  OtherAllocator> const& other) const
1213  {
1214  return other < *this;
1215  }
1216 
1217  template <
1218  bool OtherIsMulti,
1219  bool OtherIsMap,
1220  class OtherT,
1221  class OtherDuration,
1222  class OtherAllocator
1223  >
1224  bool
1226  aged_ordered_container <OtherIsMulti, OtherIsMap,
1227  Key, OtherT, OtherDuration, Compare,
1228  OtherAllocator> const& other) const
1229  {
1230  return ! (*this < other);
1231  }
1232 
1233 private:
1234  // enable_if prevents erase (reverse_iterator pos, now) from compiling
1235  template <bool is_const, class Iterator, class Base,
1237  void
1239  is_const, Iterator, Base> pos,
1240  typename clock_type::time_point const& now);
1241 
1242  template <bool maybe_propagate = std::allocator_traits <
1243  Allocator>::propagate_on_container_swap::value>
1245  swap_data (aged_ordered_container& other) noexcept;
1246 
1247  template <bool maybe_propagate = std::allocator_traits <
1248  Allocator>::propagate_on_container_swap::value>
1250  swap_data (aged_ordered_container& other) noexcept;
1251 
1252 private:
1253  config_t m_config;
1255 };
1256 
1257 //------------------------------------------------------------------------------
1258 
1259 template <bool IsMulti, bool IsMap, class Key, class T,
1260  class Clock, class Compare, class Allocator>
1263  clock_type& clock)
1264  : m_config (clock)
1265 {
1266 }
1267 
1268 template <bool IsMulti, bool IsMap, class Key, class T,
1269  class Clock, class Compare, class Allocator>
1272  clock_type& clock,
1273  Compare const& comp)
1274  : m_config (clock, comp)
1275  , m_cont (comp)
1276 {
1277 }
1278 
1279 template <bool IsMulti, bool IsMap, class Key, class T,
1280  class Clock, class Compare, class Allocator>
1283  clock_type& clock,
1284  Allocator const& alloc)
1285  : m_config (clock, alloc)
1286 {
1287 }
1288 
1289 template <bool IsMulti, bool IsMap, class Key, class T,
1290  class Clock, class Compare, class Allocator>
1293  clock_type& clock,
1294  Compare const& comp,
1295  Allocator const& alloc)
1296  : m_config (clock, comp, alloc)
1297  , m_cont (comp)
1298 {
1299 }
1300 
1301 template <bool IsMulti, bool IsMap, class Key, class T,
1302  class Clock, class Compare, class Allocator>
1303 template <class InputIt>
1305 aged_ordered_container (InputIt first, InputIt last,
1306  clock_type& clock)
1307  : m_config (clock)
1308 {
1309  insert (first, last);
1310 }
1311 
1312 template <bool IsMulti, bool IsMap, class Key, class T,
1313  class Clock, class Compare, class Allocator>
1314 template <class InputIt>
1316 aged_ordered_container (InputIt first, InputIt last,
1317  clock_type& clock,
1318  Compare const& comp)
1319  : m_config (clock, comp)
1320  , m_cont (comp)
1321 {
1322  insert (first, last);
1323 }
1324 
1325 template <bool IsMulti, bool IsMap, class Key, class T,
1326  class Clock, class Compare, class Allocator>
1327 template <class InputIt>
1329 aged_ordered_container (InputIt first, InputIt last,
1330  clock_type& clock,
1331  Allocator const& alloc)
1332  : m_config (clock, alloc)
1333 {
1334  insert (first, last);
1335 }
1336 
1337 template <bool IsMulti, bool IsMap, class Key, class T,
1338  class Clock, class Compare, class Allocator>
1339 template <class InputIt>
1341 aged_ordered_container (InputIt first, InputIt last,
1342  clock_type& clock,
1343  Compare const& comp,
1344  Allocator const& alloc)
1345  : m_config (clock, comp, alloc)
1346  , m_cont (comp)
1347 {
1348  insert (first, last);
1349 }
1350 
1351 template <bool IsMulti, bool IsMap, class Key, class T,
1352  class Clock, class Compare, class Allocator>
1355  : m_config (other.m_config)
1356  , m_cont (other.m_cont.comp())
1357 {
1358  insert (other.cbegin(), other.cend());
1359 }
1360 
1361 template <bool IsMulti, bool IsMap, class Key, class T,
1362  class Clock, class Compare, class Allocator>
1365  Allocator const& alloc)
1366  : m_config (other.m_config, alloc)
1367  , m_cont (other.m_cont.comp())
1368 {
1369  insert (other.cbegin(), other.cend());
1370 }
1371 
1372 template <bool IsMulti, bool IsMap, class Key, class T,
1373  class Clock, class Compare, class Allocator>
1376  : m_config (std::move (other.m_config))
1377  , m_cont (std::move (other.m_cont))
1378 {
1379  chronological.list = std::move (other.chronological.list);
1380 }
1381 
1382 template <bool IsMulti, bool IsMap, class Key, class T,
1383  class Clock, class Compare, class Allocator>
1386  Allocator const& alloc)
1387  : m_config (std::move (other.m_config), alloc)
1388  , m_cont (std::move(other.m_cont.comp()))
1389 {
1390  insert (other.cbegin(), other.cend());
1391  other.clear ();
1392 }
1393 
1394 template <bool IsMulti, bool IsMap, class Key, class T,
1395  class Clock, class Compare, class Allocator>
1398  clock_type& clock)
1399  : m_config (clock)
1400 {
1401  insert (init.begin(), init.end());
1402 }
1403 
1404 template <bool IsMulti, bool IsMap, class Key, class T,
1405  class Clock, class Compare, class Allocator>
1408  clock_type& clock,
1409  Compare const& comp)
1410  : m_config (clock, comp)
1411  , m_cont (comp)
1412 {
1413  insert (init.begin(), init.end());
1414 }
1415 
1416 template <bool IsMulti, bool IsMap, class Key, class T,
1417  class Clock, class Compare, class Allocator>
1420  clock_type& clock,
1421  Allocator const& alloc)
1422  : m_config (clock, alloc)
1423 {
1424  insert (init.begin(), init.end());
1425 }
1426 
1427 template <bool IsMulti, bool IsMap, class Key, class T,
1428  class Clock, class Compare, class Allocator>
1431  clock_type& clock,
1432  Compare const& comp,
1433  Allocator const& alloc)
1434  : m_config (clock, comp, alloc)
1435  , m_cont (comp)
1436 {
1437  insert (init.begin(), init.end());
1438 }
1439 
1440 template <bool IsMulti, bool IsMap, class Key, class T,
1441  class Clock, class Compare, class Allocator>
1443 ~aged_ordered_container()
1444 {
1445  clear();
1446 }
1447 
1448 template <bool IsMulti, bool IsMap, class Key, class T,
1449  class Clock, class Compare, class Allocator>
1450 auto
1452 operator= (aged_ordered_container const& other) ->
1454 {
1455  if (this != &other)
1456  {
1457  clear();
1458  this->m_config = other.m_config;
1459  insert (other.begin(), other.end());
1460  }
1461  return *this;
1462 }
1463 
1464 template <bool IsMulti, bool IsMap, class Key, class T,
1465  class Clock, class Compare, class Allocator>
1466 auto
1468 operator= (aged_ordered_container&& other) ->
1470 {
1471  clear();
1472  this->m_config = std::move (other.m_config);
1473  insert (other.begin(), other.end());
1474  other.clear();
1475  return *this;
1476 }
1477 
1478 template <bool IsMulti, bool IsMap, class Key, class T,
1479  class Clock, class Compare, class Allocator>
1480 auto
1484 {
1485  clear ();
1486  insert (init);
1487  return *this;
1488 }
1489 
1490 //------------------------------------------------------------------------------
1491 
1492 template <bool IsMulti, bool IsMap, class Key, class T,
1493  class Clock, class Compare, class Allocator>
1494 template <class K, bool maybe_multi, bool maybe_map, class>
1497 at (K const& k)
1498 {
1499  auto const iter (m_cont.find (k,
1500  std::cref (m_config.key_compare())));
1501  if (iter == m_cont.end())
1502  throw std::out_of_range ("key not found");
1503  return iter->value.second;
1504 }
1505 
1506 template <bool IsMulti, bool IsMap, class Key, class T,
1507  class Clock, class Compare, class Allocator>
1508 template <class K, bool maybe_multi, bool maybe_map, class>
1511 at (K const& k) const
1512 {
1513  auto const iter (m_cont.find (k,
1514  std::cref (m_config.key_compare())));
1515  if (iter == m_cont.end())
1516  throw std::out_of_range ("key not found");
1517  return iter->value.second;
1518 }
1519 
1520 template <bool IsMulti, bool IsMap, class Key, class T,
1521  class Clock, class Compare, class Allocator>
1522 template <bool maybe_multi, bool maybe_map, class>
1525 operator[] (Key const& key)
1526 {
1527  typename cont_type::insert_commit_data d;
1528  auto const result (m_cont.insert_check (key,
1529  std::cref (m_config.key_compare()), d));
1530  if (result.second)
1531  {
1532  element* const p (new_element (
1533  std::piecewise_construct, std::forward_as_tuple (key),
1534  std::forward_as_tuple ()));
1535  m_cont.insert_commit (*p, d);
1536  chronological.list.push_back (*p);
1537  return p->value.second;
1538  }
1539  return result.first->value.second;
1540 }
1541 
1542 template <bool IsMulti, bool IsMap, class Key, class T,
1543  class Clock, class Compare, class Allocator>
1544 template <bool maybe_multi, bool maybe_map, class>
1547 operator[] (Key&& key)
1548 {
1549  typename cont_type::insert_commit_data d;
1550  auto const result (m_cont.insert_check (key,
1551  std::cref (m_config.key_compare()), d));
1552  if (result.second)
1553  {
1554  element* const p (new_element (
1555  std::piecewise_construct,
1556  std::forward_as_tuple (std::move (key)),
1557  std::forward_as_tuple ()));
1558  m_cont.insert_commit (*p, d);
1559  chronological.list.push_back (*p);
1560  return p->value.second;
1561  }
1562  return result.first->value.second;
1563 }
1564 
1565 //------------------------------------------------------------------------------
1566 
1567 template <bool IsMulti, bool IsMap, class Key, class T,
1568  class Clock, class Compare, class Allocator>
1569 void
1571 clear()
1572 {
1573  for (auto iter (chronological.list.begin());
1574  iter != chronological.list.end();)
1575  delete_element (&*iter++);
1576  chronological.list.clear();
1577  m_cont.clear();
1578 }
1579 
1580 // map, set
1581 template <bool IsMulti, bool IsMap, class Key, class T,
1582  class Clock, class Compare, class Allocator>
1583 template <bool maybe_multi>
1584 auto
1586 insert (value_type const& value) ->
1587  typename std::enable_if <! maybe_multi,
1589 {
1590  typename cont_type::insert_commit_data d;
1591  auto const result (m_cont.insert_check (extract (value),
1592  std::cref (m_config.key_compare()), d));
1593  if (result.second)
1594  {
1595  element* const p (new_element (value));
1596  auto const iter (m_cont.insert_commit (*p, d));
1597  chronological.list.push_back (*p);
1598  return std::make_pair (iterator (iter), true);
1599  }
1600  return std::make_pair (iterator (result.first), false);
1601 }
1602 
1603 // multimap, multiset
1604 template <bool IsMulti, bool IsMap, class Key, class T,
1605  class Clock, class Compare, class Allocator>
1606 template <bool maybe_multi>
1607 auto
1609 insert (value_type const& value) ->
1610  typename std::enable_if <maybe_multi,
1611  iterator>::type
1612 {
1613  auto const before (m_cont.upper_bound (
1614  extract (value), std::cref (m_config.key_compare())));
1615  element* const p (new_element (value));
1616  chronological.list.push_back (*p);
1617  auto const iter (m_cont.insert_before (before, *p));
1618  return iterator (iter);
1619 }
1620 
1621 // set
1622 template <bool IsMulti, bool IsMap, class Key, class T,
1623  class Clock, class Compare, class Allocator>
1624 template <bool maybe_multi, bool maybe_map>
1625 auto
1627 insert (value_type&& value) ->
1628  typename std::enable_if <! maybe_multi && ! maybe_map,
1630 {
1631  typename cont_type::insert_commit_data d;
1632  auto const result (m_cont.insert_check (extract (value),
1633  std::cref (m_config.key_compare()), d));
1634  if (result.second)
1635  {
1636  element* const p (new_element (std::move (value)));
1637  auto const iter (m_cont.insert_commit (*p, d));
1638  chronological.list.push_back (*p);
1639  return std::make_pair (iterator (iter), true);
1640  }
1641  return std::make_pair (iterator (result.first), false);
1642 }
1643 
1644 // multiset
1645 template <bool IsMulti, bool IsMap, class Key, class T,
1646  class Clock, class Compare, class Allocator>
1647 template <bool maybe_multi, bool maybe_map>
1648 auto
1650 insert (value_type&& value) ->
1651  typename std::enable_if <maybe_multi && ! maybe_map,
1652  iterator>::type
1653 {
1654  auto const before (m_cont.upper_bound (
1655  extract (value), std::cref (m_config.key_compare())));
1656  element* const p (new_element (std::move (value)));
1657  chronological.list.push_back (*p);
1658  auto const iter (m_cont.insert_before (before, *p));
1659  return iterator (iter);
1660 }
1661 
1662 //---
1663 
1664 // map, set
1665 template <bool IsMulti, bool IsMap, class Key, class T,
1666  class Clock, class Compare, class Allocator>
1667 template <bool maybe_multi>
1668 auto
1670 insert (const_iterator hint, value_type const& value) ->
1671  typename std::enable_if <! maybe_multi,
1672  iterator>::type
1673 {
1674  typename cont_type::insert_commit_data d;
1675  auto const result (m_cont.insert_check (hint.iterator(),
1676  extract (value), std::cref (m_config.key_compare()), d));
1677  if (result.second)
1678  {
1679  element* const p (new_element (value));
1680  auto const iter (m_cont.insert_commit (*p, d));
1681  chronological.list.push_back (*p);
1682  return iterator (iter);
1683  }
1684  return iterator (result.first);
1685 }
1686 
1687 // map, set
1688 template <bool IsMulti, bool IsMap, class Key, class T,
1689  class Clock, class Compare, class Allocator>
1690 template <bool maybe_multi>
1691 auto
1693 insert (const_iterator hint, value_type&& value) ->
1694  typename std::enable_if <! maybe_multi,
1695  iterator>::type
1696 {
1697  typename cont_type::insert_commit_data d;
1698  auto const result (m_cont.insert_check (hint.iterator(),
1699  extract (value), std::cref (m_config.key_compare()), d));
1700  if (result.second)
1701  {
1702  element* const p (new_element (std::move (value)));
1703  auto const iter (m_cont.insert_commit (*p, d));
1704  chronological.list.push_back (*p);
1705  return iterator (iter);
1706  }
1707  return iterator (result.first);
1708 }
1709 
1710 // map, set
1711 template <bool IsMulti, bool IsMap, class Key, class T,
1712  class Clock, class Compare, class Allocator>
1713 template <bool maybe_multi, class... Args>
1714 auto
1716 emplace (Args&&... args) ->
1717  typename std::enable_if <! maybe_multi,
1719 {
1720  // VFALCO NOTE Its unfortunate that we need to
1721  // construct element here
1722  element* const p (new_element (
1723  std::forward <Args> (args)...));
1724  typename cont_type::insert_commit_data d;
1725  auto const result (m_cont.insert_check (extract (p->value),
1726  std::cref (m_config.key_compare()), d));
1727  if (result.second)
1728  {
1729  auto const iter (m_cont.insert_commit (*p, d));
1730  chronological.list.push_back (*p);
1731  return std::make_pair (iterator (iter), true);
1732  }
1733  delete_element (p);
1734  return std::make_pair (iterator (result.first), false);
1735 }
1736 
1737 // multiset, multimap
1738 template <bool IsMulti, bool IsMap, class Key, class T,
1739  class Clock, class Compare, class Allocator>
1740 template <bool maybe_multi, class... Args>
1741 auto
1743 emplace (Args&&... args) ->
1744  typename std::enable_if <maybe_multi,
1745  iterator>::type
1746 {
1747  element* const p (new_element (
1748  std::forward <Args> (args)...));
1749  auto const before (m_cont.upper_bound (extract (p->value),
1750  std::cref (m_config.key_compare())));
1751  chronological.list.push_back (*p);
1752  auto const iter (m_cont.insert_before (before, *p));
1753  return iterator (iter);
1754 }
1755 
1756 // map, set
1757 template <bool IsMulti, bool IsMap, class Key, class T,
1758  class Clock, class Compare, class Allocator>
1759 template <bool maybe_multi, class... Args>
1760 auto
1762 emplace_hint (const_iterator hint, Args&&... args) ->
1763  typename std::enable_if <! maybe_multi,
1765 {
1766  // VFALCO NOTE Its unfortunate that we need to
1767  // construct element here
1768  element* const p (new_element (
1769  std::forward <Args> (args)...));
1770  typename cont_type::insert_commit_data d;
1771  auto const result (m_cont.insert_check (hint.iterator(),
1772  extract (p->value), std::cref (m_config.key_compare()), d));
1773  if (result.second)
1774  {
1775  auto const iter (m_cont.insert_commit (*p, d));
1776  chronological.list.push_back (*p);
1777  return std::make_pair (iterator (iter), true);
1778  }
1779  delete_element (p);
1780  return std::make_pair (iterator (result.first), false);
1781 }
1782 
1783 template <bool IsMulti, bool IsMap, class Key, class T,
1784  class Clock, class Compare, class Allocator>
1785 template <bool is_const, class Iterator, class Base, class>
1789 {
1790  unlink_and_delete_element(&*((pos++).iterator()));
1792  false, Iterator, Base> (pos.iterator());
1793 }
1794 
1795 template <bool IsMulti, bool IsMap, class Key, class T,
1796  class Clock, class Compare, class Allocator>
1797 template <bool is_const, class Iterator, class Base, class>
1802 {
1803  for (; first != last;)
1804  unlink_and_delete_element(&*((first++).iterator()));
1805 
1807  false, Iterator, Base> (first.iterator());
1808 }
1809 
1810 template <bool IsMulti, bool IsMap, class Key, class T,
1811  class Clock, class Compare, class Allocator>
1812 template <class K>
1813 auto
1815 erase (K const& k) ->
1816  size_type
1817 {
1818  auto iter (m_cont.find (k,
1819  std::cref (m_config.key_compare())));
1820  if (iter == m_cont.end())
1821  return 0;
1822  size_type n (0);
1823  for (;;)
1824  {
1825  auto p (&*iter++);
1826  bool const done (
1827  m_config (*p, extract (iter->value)));
1828  unlink_and_delete_element (p);
1829  ++n;
1830  if (done)
1831  break;
1832  }
1833  return n;
1834 }
1835 
1836 template <bool IsMulti, bool IsMap, class Key, class T,
1837  class Clock, class Compare, class Allocator>
1838 void
1840 swap (aged_ordered_container& other) noexcept
1841 {
1842  swap_data (other);
1843  std::swap (chronological, other.chronological);
1844  std::swap (m_cont, other.m_cont);
1845 }
1846 
1847 //------------------------------------------------------------------------------
1848 
1849 template <bool IsMulti, bool IsMap, class Key, class T,
1850  class Clock, class Compare, class Allocator>
1851 template <class K>
1852 auto
1854 touch (K const& k) ->
1855  size_type
1856 {
1857  auto const now (clock().now());
1858  size_type n (0);
1859  auto const range (equal_range (k));
1860  for (auto iter : range)
1861  {
1862  touch (iter, now);
1863  ++n;
1864  }
1865  return n;
1866 }
1867 
1868 //------------------------------------------------------------------------------
1869 
1870 template <bool IsMulti, bool IsMap, class Key, class T,
1871  class Clock, class Compare, class Allocator>
1872 template <bool OtherIsMulti, bool OtherIsMap,
1873  class OtherT, class OtherDuration, class OtherAllocator>
1874 bool
1876 operator== (
1877  aged_ordered_container <OtherIsMulti, OtherIsMap,
1878  Key, OtherT, OtherDuration, Compare,
1879  OtherAllocator> const& other) const
1880 {
1881  using Other = aged_ordered_container <OtherIsMulti, OtherIsMap,
1882  Key, OtherT, OtherDuration, Compare,
1883  OtherAllocator>;
1884  if (size() != other.size())
1885  return false;
1887  return std::equal (cbegin(), cend(), other.cbegin(), other.cend(),
1888  [&eq, &other](value_type const& lhs,
1889  typename Other::value_type const& rhs)
1890  {
1891  return eq (extract (lhs), other.extract (rhs));
1892  });
1893 }
1894 
1895 //------------------------------------------------------------------------------
1896 
1897 template <bool IsMulti, bool IsMap, class Key, class T,
1898  class Clock, class Compare, class Allocator>
1899 template <bool is_const, class Iterator, class Base, class>
1900 void
1903  is_const, Iterator, Base> pos,
1904  typename clock_type::time_point const& now)
1905 {
1906  auto& e (*pos.iterator());
1907  e.when = now;
1908  chronological.list.erase (chronological.list.iterator_to (e));
1909  chronological.list.push_back (e);
1910 }
1911 
1912 template <bool IsMulti, bool IsMap, class Key, class T,
1913  class Clock, class Compare, class Allocator>
1914 template <bool maybe_propagate>
1917 swap_data (aged_ordered_container& other) noexcept
1918 {
1919  std::swap (m_config.key_compare(), other.m_config.key_compare());
1920  std::swap (m_config.alloc(), other.m_config.alloc());
1921  std::swap (m_config.clock, other.m_config.clock);
1922 }
1923 
1924 template <bool IsMulti, bool IsMap, class Key, class T,
1925  class Clock, class Compare, class Allocator>
1926 template <bool maybe_propagate>
1929 swap_data (aged_ordered_container& other) noexcept
1930 {
1931  std::swap (m_config.key_compare(), other.m_config.key_compare());
1932  std::swap (m_config.clock, other.m_config.clock);
1933 }
1934 
1935 }
1936 
1937 //------------------------------------------------------------------------------
1938 
1939 template <bool IsMulti, bool IsMap, class Key, class T,
1940  class Clock, class Compare, class Allocator>
1942  IsMulti, IsMap, Key, T, Clock, Compare, Allocator>>
1943  : std::true_type
1944 {
1945  explicit is_aged_container() = default;
1946 };
1947 
1948 // Free functions
1949 
1950 template <bool IsMulti, bool IsMap, class Key, class T,
1951  class Clock, class Compare, class Allocator>
1952 void swap (
1953  beast::detail::aged_ordered_container <IsMulti, IsMap,
1954  Key, T, Clock, Compare, Allocator>& lhs,
1955  beast::detail::aged_ordered_container <IsMulti, IsMap,
1956  Key, T, Clock, Compare, Allocator>& rhs) noexcept
1957 {
1958  lhs.swap (rhs);
1959 }
1960 
1962 template <bool IsMulti, bool IsMap, class Key, class T,
1963  class Clock, class Compare, class Allocator,
1964  class Rep, class Period>
1966  IsMulti, IsMap, Key, T, Clock, Compare, Allocator>& c,
1968 {
1969  std::size_t n (0);
1970  auto const expired (c.clock().now() - age);
1971  for (auto iter (c.chronological.cbegin());
1972  iter != c.chronological.cend() &&
1973  iter.when() <= expired;)
1974  {
1975  iter = c.erase (iter);
1976  ++n;
1977  }
1978  return n;
1979 }
1980 
1981 }
1982 
1983 #endif
std::is_standard_layout
beast::detail::aged_ordered_container::config_t::alloc
ElementAllocator const & alloc() const
Definition: aged_ordered_container.h:398
beast::detail::aged_ordered_container::new_element
element * new_element(Args &&... args)
Definition: aged_ordered_container.h:408
beast::detail::aged_ordered_container::erase
beast::detail::aged_container_iterator< false, Iterator, Base > erase(beast::detail::aged_container_iterator< is_const, Iterator, Base > pos)
Definition: aged_ordered_container.h:1788
beast::detail::aged_ordered_container::chronological_t::rbegin
reverse_iterator rbegin()
Definition: aged_ordered_container.h:525
beast::detail::aged_ordered_container::empty
bool empty() const noexcept
Definition: aged_ordered_container.h:811
beast::detail::aged_ordered_container::operator==
bool operator==(aged_ordered_container< OtherIsMulti, OtherIsMap, Key, OtherT, OtherDuration, Compare, OtherAllocator > const &other) const
Definition: aged_ordered_container.h:1876
beast::detail::aged_ordered_container::pair_value_compare::second_argument
value_type second_argument
Definition: aged_ordered_container.h:173
beast::detail::aged_ordered_container::chronological_t::begin
const_iterator begin() const
Definition: aged_ordered_container.h:500
beast::detail::aged_ordered_container::clear
void clear()
Definition: aged_ordered_container.h:1571
beast::detail::aged_ordered_container::element::stashed::time_point
typename aged_ordered_container::time_point time_point
Definition: aged_ordered_container.h:128
std::chrono::steady_clock
beast::detail::aged_ordered_container::config_t::key_compare
KeyValueCompare const & key_compare() const
Definition: aged_ordered_container.h:387
beast::detail::aged_ordered_container::config_t::config_t
config_t(clock_type &clock_, Compare const &comp, Allocator const &alloc_)
Definition: aged_ordered_container.h:311
beast::detail::aged_ordered_container::extract
static Key const & extract(value_type const &value)
Definition: aged_ordered_container.h:105
std::binary_function
beast::detail::aged_ordered_container::chronological_t::cend
const_iterator cend() const
Definition: aged_ordered_container.h:520
beast::detail::aged_ordered_container::operator>
bool operator>(aged_ordered_container< OtherIsMulti, OtherIsMap, Key, OtherT, OtherDuration, Compare, OtherAllocator > const &other) const
Definition: aged_ordered_container.h:1209
beast::detail::aged_ordered_container::emplace_hint
auto emplace_hint(const_iterator hint, Args &&... args) -> typename std::enable_if<! maybe_multi, std::pair< iterator, bool >>::type
Definition: aged_ordered_container.h:1762
std::false_type
beast::detail::aged_ordered_container::lower_bound
iterator lower_bound(K const &k)
Definition: aged_ordered_container.h:1076
beast::detail::aged_ordered_container::chronological_t::list
list_type list
Definition: aged_ordered_container.h:582
beast::detail::aged_ordered_container::begin
const_iterator begin() const
Definition: aged_ordered_container.h:719
std::equal
T equal(T... args)
beast::detail::aged_ordered_container< beast::IP::Address >::mapped_type
T mapped_type
Definition: aged_ordered_container.h:93
utility
beast::detail::aged_ordered_container::config_t::operator=
config_t & operator=(config_t const &other)
Definition: aged_ordered_container.h:353
beast::detail::aged_ordered_container::config_t::config_t
config_t(clock_type &clock_)
Definition: aged_ordered_container.h:289
beast::detail::aged_ordered_container::value_comp
value_compare value_comp() const
Definition: aged_ordered_container.h:1123
beast::detail::aged_ordered_container::rend
reverse_iterator rend()
Definition: aged_ordered_container.h:767
beast::detail::aged_ordered_container::chronological_t::crend
const_reverse_iterator crend() const
Definition: aged_ordered_container.h:550
beast::detail::aged_ordered_container< beast::IP::Address >::value_compare
typename std::conditional< IsMap, pair_value_compare, std::less< Key > >::type value_compare
Definition: aged_ordered_container.h:452
functional
beast::detail::aged_ordered_container::max_size
size_type max_size() const noexcept
Definition: aged_ordered_container.h:823
std::pair
beast::detail::aged_ordered_container::at
std::conditional< IsMap, T, void * >::type & at(K const &k)
Definition: aged_ordered_container.h:1497
beast::detail::is_boost_reverse_iterator::is_boost_reverse_iterator
is_boost_reverse_iterator()=default
beast::detail::aged_ordered_container::element::stashed::stashed
stashed()=default
beast::detail::aged_ordered_container::KeyValueCompare
Definition: aged_ordered_container.h:202
beast::is_aged_container
Definition: aged_container.h:28
beast::detail::aged_ordered_container< beast::IP::Address >::const_reference
value_type const & const_reference
Definition: aged_ordered_container.h:455
beast::detail::aged_ordered_container::config_t::config_t
config_t(clock_type &clock_, Compare const &comp)
Definition: aged_ordered_container.h:295
std::chrono::duration
beast::detail::aged_ordered_container::KeyValueCompare::compare
Compare const & compare() const
Definition: aged_ordered_container.h:258
beast::detail::aged_ordered_container::lower_bound
const_iterator lower_bound(K const &k) const
Definition: aged_ordered_container.h:1085
iterator
beast::detail::aged_ordered_container::config_t::config_t
config_t(config_t &&other, Allocator const &alloc)
Definition: aged_ordered_container.h:346
beast::detail::aged_ordered_container::config_t::key_compare
KeyValueCompare & key_compare()
Definition: aged_ordered_container.h:382
beast::detail::aged_ordered_container::chronological_t::cbegin
const_iterator cbegin() const
Definition: aged_ordered_container.h:505
std::reference_wrapper::get
T get(T... args)
beast::detail::aged_ordered_container< beast::IP::Address >::pointer
typename std::allocator_traits< std::allocator< typename std::conditional< IsMap, std::pair< Key const, T >, Key >::type > >::pointer pointer
Definition: aged_ordered_container.h:457
beast::compare
int compare(SemanticVersion const &lhs, SemanticVersion const &rhs)
Compare two SemanticVersions against each other.
Definition: SemanticVersion.cpp:251
std::unique_ptr::release
T release(T... args)
beast::detail::aged_ordered_container::equal_range
std::pair< const_iterator, const_iterator > equal_range(K const &k) const
Definition: aged_ordered_container.h:1065
beast::detail::aged_ordered_container::insert
std::enable_if< maybe_map &&std::is_constructible< value_type, P && >::value, typename std::conditional< IsMulti, iterator, std::pair< iterator, bool > >::type >::type insert(const_iterator hint, P &&value)
Definition: aged_ordered_container.h:930
beast::detail::aged_ordered_container::element::stashed
Definition: aged_ordered_container.h:123
beast::detail::aged_ordered_container::chronological_t::crbegin
const_reverse_iterator crbegin() const
Definition: aged_ordered_container.h:535
beast::detail::aged_ordered_container::end
const_iterator end() const
Definition: aged_ordered_container.h:737
beast::detail::aged_ordered_container::m_cont
cont_type m_cont
Definition: aged_ordered_container.h:1254
beast::detail::aged_ordered_container::iterator_to
iterator iterator_to(value_type &value)
Definition: aged_ordered_container.h:785
beast::detail::aged_ordered_container::config_t::config_t
config_t(config_t const &other)
Definition: aged_ordered_container.h:321
boost
Definition: IPAddress.h:127
beast::detail::empty_base_optimization< Compare >
beast::detail::aged_ordered_container::operator>=
bool operator>=(aged_ordered_container< OtherIsMulti, OtherIsMap, Key, OtherT, OtherDuration, Compare, OtherAllocator > const &other) const
Definition: aged_ordered_container.h:1225
beast::detail::aged_ordered_container::unlink_and_delete_element
void unlink_and_delete_element(element const *p)
Definition: aged_ordered_container.h:439
beast::detail::aged_ordered_container::insert
auto insert(value_type const &value) -> typename std::enable_if<! maybe_multi, std::pair< iterator, bool >>::type
Definition: aged_ordered_container.h:1586
beast::detail::aged_ordered_container::element::element
element(time_point const &when_, Args &&... args)
Definition: aged_ordered_container.h:153
beast::detail::aged_ordered_container::chronological_t::rend
reverse_iterator rend()
Definition: aged_ordered_container.h:540
std::less
beast::detail::aged_ordered_container::config_t::config_t
config_t(config_t &&other)
Definition: aged_ordered_container.h:338
beast::detail::empty_base_optimization< ElementAllocator >::member
ElementAllocator & member() noexcept
Definition: empty_base_optimization.h:48
std::allocator_traits
algorithm
beast::detail::aged_ordered_container< beast::IP::Address >::time_point
typename clock_type::time_point time_point
Definition: aged_ordered_container.h:90
beast::detail::aged_ordered_container::chronological_t::iterator_to
iterator iterator_to(value_type &value)
Definition: aged_ordered_container.h:555
beast::detail::aged_ordered_container::count
size_type count(K const &k) const
Definition: aged_ordered_container.h:1027
beast::detail::aged_ordered_container< beast::IP::Address >::const_pointer
typename std::allocator_traits< std::allocator< typename std::conditional< IsMap, std::pair< Key const, T >, Key >::type > >::const_pointer const_pointer
Definition: aged_ordered_container.h:459
beast::detail::aged_ordered_container::config_t::clock
std::reference_wrapper< clock_type > clock
Definition: aged_ordered_container.h:404
beast::detail::aged_ordered_container::operator<=
bool operator<=(aged_ordered_container< OtherIsMulti, OtherIsMap, Key, OtherT, OtherDuration, Compare, OtherAllocator > const &other) const
Definition: aged_ordered_container.h:1193
beast::detail::aged_ordered_container::chronological_t::iterator
beast::detail::aged_container_iterator< ! IsMap, typename list_type::iterator > iterator
Definition: aged_ordered_container.h:487
beast::detail::aged_ordered_container::emplace_hint
std::enable_if< maybe_multi, iterator >::type emplace_hint(const_iterator, Args &&... args)
Definition: aged_ordered_container.h:974
beast::detail::aged_associative_container_extract_t
Definition: aged_associative_container.h:30
beast::detail::aged_ordered_container::insert
std::enable_if< maybe_multi, iterator >::type insert(const_iterator, value_type const &value)
Definition: aged_ordered_container.h:878
beast::detail::aged_ordered_container::chronological_t::iterator_to
const_iterator iterator_to(value_type const &value) const
Definition: aged_ordered_container.h:564
beast::detail::aged_ordered_container< beast::IP::Address >::cont_type
typename std::conditional< IsMulti, typename boost::intrusive::make_multiset< element, boost::intrusive::constant_time_size< true >, boost::intrusive::compare< KeyValueCompare > >::type, typename boost::intrusive::make_set< element, boost::intrusive::constant_time_size< true >, boost::intrusive::compare< KeyValueCompare > >::type >::type cont_type
Definition: aged_ordered_container.h:277
beast::detail::aged_ordered_container::chronological_t::end
const_iterator end() const
Definition: aged_ordered_container.h:515
beast::detail::aged_ordered_container::key_comp
key_compare key_comp() const
Definition: aged_ordered_container.h:1116
beast::detail::aged_ordered_container::element::element
element(time_point const &when_, value_type const &value_)
Definition: aged_ordered_container.h:131
std::addressof
T addressof(T... args)
std::reference_wrapper
beast::detail::aged_ordered_container::~aged_ordered_container
~aged_ordered_container()
Definition: aged_ordered_container.h:1443
beast::detail::aged_ordered_container::pair_value_compare::pair_value_compare
pair_value_compare(Compare const &compare)
Definition: aged_ordered_container.h:194
beast::detail::aged_ordered_container::chronological_t::end
iterator end()
Definition: aged_ordered_container.h:510
beast::detail::aged_ordered_container::swap
void swap(aged_ordered_container &other) noexcept
Definition: aged_ordered_container.h:1840
beast::detail::aged_ordered_container::find
iterator find(K const &k)
Definition: aged_ordered_container.h:1036
beast::detail::aged_ordered_container::cend
const_iterator cend() const
Definition: aged_ordered_container.h:743
beast::detail::aged_ordered_container::chronological_t::const_reverse_iterator
beast::detail::aged_container_iterator< true, typename list_type::reverse_iterator > const_reverse_iterator
Definition: aged_ordered_container.h:493
beast::detail::aged_ordered_container::list_type
typename boost::intrusive::make_list< element, boost::intrusive::constant_time_size< false > >::type list_type
Definition: aged_ordered_container.h:265
std::enable_if
beast::detail::aged_ordered_container::clock
clock_type & clock()
Definition: aged_ordered_container.h:659
beast::detail::aged_ordered_container::pair_value_compare::first_argument
value_type first_argument
Definition: aged_ordered_container.h:172
beast::detail::aged_ordered_container::chronological_t::begin
iterator begin()
Definition: aged_ordered_container.h:495
beast::detail::aged_ordered_container::element::element
element(time_point const &when_, value_type &&value_)
Definition: aged_ordered_container.h:139
beast::detail::aged_ordered_container::chronological_t::rend
const_reverse_iterator rend() const
Definition: aged_ordered_container.h:545
std::lexicographical_compare
T lexicographical_compare(T... args)
beast::detail::aged_ordered_container::chronological_t
Definition: aged_ordered_container.h:481
std::allocator_traits::allocate
T allocate(T... args)
beast::detail::aged_ordered_container::reverse_iterator
beast::detail::aged_container_iterator< ! IsMap, typename cont_type::reverse_iterator > reverse_iterator
Definition: aged_ordered_container.h:468
beast::detail::aged_ordered_container< beast::IP::Address >::reference
value_type & reference
Definition: aged_ordered_container.h:454
std::allocator_traits::deallocate
T deallocate(T... args)
beast::detail::aged_ordered_container::operator!=
bool operator!=(aged_ordered_container< OtherIsMulti, OtherIsMap, Key, OtherT, OtherDuration, Compare, OtherAllocator > const &other) const
Definition: aged_ordered_container.h:1159
beast::detail::aged_ordered_container::config_t::compare
Compare & compare()
Definition: aged_ordered_container.h:372
std::allocator_traits::destroy
T destroy(T... args)
beast::detail::aged_ordered_container::element
Definition: aged_ordered_container.h:111
beast::detail::aged_ordered_container::iterator_to
const_iterator iterator_to(value_type const &value) const
Definition: aged_ordered_container.h:795
beast::aged_ordered_container
Definition: aged_container_iterator.h:29
beast::detail::aged_ordered_container::clock
clock_type const & clock() const
Definition: aged_ordered_container.h:665
beast::detail::aged_ordered_container::config_t::config_t
config_t(config_t const &other, Allocator const &alloc)
Definition: aged_ordered_container.h:331
beast::detail::aged_ordered_container::clock_type
abstract_clock< Clock > clock_type
Definition: aged_ordered_container.h:89
beast::detail::init
void init(ripemd160_context &ctx) noexcept
Definition: ripemd_context.h:343
std::forward_as_tuple
T forward_as_tuple(T... args)
beast::detail::aged_ordered_container::crbegin
const_reverse_iterator crbegin() const
Definition: aged_ordered_container.h:761
beast::detail::aged_ordered_container::upper_bound
iterator upper_bound(K const &k)
Definition: aged_ordered_container.h:1094
beast::detail::aged_ordered_container::crend
const_reverse_iterator crend() const
Definition: aged_ordered_container.h:779
beast::abstract_clock< std::chrono::steady_clock >
memory
beast::detail::aged_ordered_container::operator[]
std::conditional< IsMap, T, void * >::type & operator[](Key const &key)
Definition: aged_ordered_container.h:1525
beast::detail::aged_ordered_container::aged_ordered_container
aged_ordered_container()=delete
std::swap
T swap(T... args)
beast::detail::aged_ordered_container::pair_value_compare::pair_value_compare
pair_value_compare()
Definition: aged_ordered_container.h:182
std::equal_to
beast::detail::aged_ordered_container::element::value
value_type value
Definition: aged_ordered_container.h:159
beast::detail::aged_ordered_container::get_allocator
allocator_type get_allocator() const
Definition: aged_ordered_container.h:653
beast::detail::aged_ordered_container::const_reverse_iterator
beast::detail::aged_container_iterator< true, typename cont_type::reverse_iterator > const_reverse_iterator
Definition: aged_ordered_container.h:470
beast::detail::aged_ordered_container::chronological_t::rbegin
const_reverse_iterator rbegin() const
Definition: aged_ordered_container.h:530
beast::detail::aged_ordered_container< beast::IP::Address >::value_type
typename std::conditional< IsMap, std::pair< Key const, T >, Key >::type value_type
Definition: aged_ordered_container.h:95
beast::detail::aged_ordered_container::size
size_type size() const noexcept
Definition: aged_ordered_container.h:817
beast::detail::aged_ordered_container::end
iterator end()
Definition: aged_ordered_container.h:731
beast::detail::aged_ordered_container::operator=
aged_ordered_container & operator=(aged_ordered_container const &other)
Definition: aged_ordered_container.h:1452
beast::detail::aged_ordered_container::insert
std::enable_if< maybe_map &&std::is_constructible< value_type, P && >::value, typename std::conditional< IsMulti, iterator, std::pair< iterator, bool > >::type >::type insert(P &&value)
Definition: aged_ordered_container.h:913
beast::detail::aged_ordered_container::chronological_t::reverse_iterator
beast::detail::aged_container_iterator< ! IsMap, typename list_type::reverse_iterator > reverse_iterator
Definition: aged_ordered_container.h:491
beast::detail::aged_ordered_container::element::stashed::value_type
typename aged_ordered_container::value_type value_type
Definition: aged_ordered_container.h:127
beast::detail::aged_ordered_container
Associative container where each element is also indexed by time.
Definition: aged_ordered_container.h:86
beast::detail::aged_ordered_container::rbegin
const_reverse_iterator rbegin() const
Definition: aged_ordered_container.h:755
beast::detail::aged_ordered_container::upper_bound
const_iterator upper_bound(K const &k) const
Definition: aged_ordered_container.h:1103
beast::detail::aged_ordered_container::operator<
bool operator<(aged_ordered_container< OtherIsMulti, OtherIsMap, Key, OtherT, OtherDuration, Compare, OtherAllocator > const &other) const
Definition: aged_ordered_container.h:1175
beast::detail::aged_ordered_container::chronological
class beast::detail::aged_ordered_container::chronological_t chronological
beast::detail::aged_ordered_container::config_t::compare
Compare const & compare() const
Definition: aged_ordered_container.h:377
beast::detail::aged_ordered_container::insert
void insert(std::initializer_list< value_type > init)
Definition: aged_ordered_container.h:944
std
STL namespace.
beast::detail::aged_ordered_container::KeyValueCompare::compare
Compare & compare()
Definition: aged_ordered_container.h:253
beast::detail::aged_ordered_container::begin
iterator begin()
Definition: aged_ordered_container.h:713
std::ptrdiff_t
beast::detail::aged_ordered_container::key_compare
Compare key_compare
Definition: aged_ordered_container.h:448
beast::expire
std::enable_if< is_aged_container< AgedContainer >::value, std::size_t >::type expire(AgedContainer &c, std::chrono::duration< Rep, Period > const &age)
Expire aged container items past the specified age.
Definition: aged_container_utility.h:35
std::out_of_range
STL class.
std::allocator
STL class.
beast::detail::aged_ordered_container::swap_data
std::enable_if< maybe_propagate >::type swap_data(aged_ordered_container &other) noexcept
Definition: aged_ordered_container.h:1917
std::is_constructible
beast::detail::aged_container_iterator::iterator
Iterator const & iterator() const
Definition: aged_container_iterator.h:162
std::size_t
beast::detail::aged_ordered_container::KeyValueCompare::first_argument
Key first_argument
Definition: aged_ordered_container.h:210
beast::detail::aged_ordered_container::pair_value_compare::result_type
bool result_type
Definition: aged_ordered_container.h:174
std::make_pair
T make_pair(T... args)
beast::detail::aged_ordered_container::config_t::alloc
ElementAllocator & alloc()
Definition: aged_ordered_container.h:392
beast::detail::aged_ordered_container::config_t
Definition: aged_ordered_container.h:284
beast::detail::aged_ordered_container< beast::IP::Address >::ElementAllocator
typename std::allocator_traits< std::allocator< typename std::conditional< IsMap, std::pair< Key const, T >, Key >::type > >::template rebind_alloc< element > ElementAllocator
Definition: aged_ordered_container.h:280
beast::detail::aged_ordered_container::emplace
auto emplace(Args &&... args) -> typename std::enable_if<! maybe_multi, std::pair< iterator, bool >>::type
Definition: aged_ordered_container.h:1716
beast::detail::aged_ordered_container::insert
void insert(InputIt first, InputIt last)
Definition: aged_ordered_container.h:937
std::conditional
beast::detail::aged_ordered_container::config_t::config_t
config_t(clock_type &clock_, Allocator const &alloc_)
Definition: aged_ordered_container.h:303
beast::detail::aged_ordered_container::rbegin
reverse_iterator rbegin()
Definition: aged_ordered_container.h:749
beast::detail::aged_ordered_container::equal_range
std::pair< iterator, iterator > equal_range(K const &k)
Definition: aged_ordered_container.h:1054
beast::detail::aged_ordered_container::cbegin
const_iterator cbegin() const
Definition: aged_ordered_container.h:725
beast::detail::aged_ordered_container::rend
const_reverse_iterator rend() const
Definition: aged_ordered_container.h:773
beast::detail::aged_ordered_container::chronological_t::const_iterator
beast::detail::aged_container_iterator< true, typename list_type::iterator > const_iterator
Definition: aged_ordered_container.h:489
beast::detail::aged_ordered_container::iterator
beast::detail::aged_container_iterator< ! IsMap, typename cont_type::iterator > iterator
Definition: aged_ordered_container.h:464
beast::detail::is_boost_reverse_iterator
Definition: aged_ordered_container.h:45
std::unique_ptr
STL class.
beast::detail::aged_ordered_container::pair_value_compare::pair_value_compare
pair_value_compare(pair_value_compare const &other)
Definition: aged_ordered_container.h:186
beast::detail::aged_ordered_container::m_config
config_t m_config
Definition: aged_ordered_container.h:1253
beast::detail::aged_ordered_container::chronological_t::chronological_t
chronological_t()
Definition: aged_ordered_container.h:574
beast::detail::aged_ordered_container::const_iterator
beast::detail::aged_container_iterator< true, typename cont_type::iterator > const_iterator
Definition: aged_ordered_container.h:466
beast::abstract_clock::time_point
typename Clock::time_point time_point
Definition: abstract_clock.h:63
beast::detail::aged_ordered_container::delete_element
void delete_element(element const *p)
Definition: aged_ordered_container.h:432
beast::detail::aged_ordered_container::find
const_iterator find(K const &k) const
Definition: aged_ordered_container.h:1045
beast::detail::aged_container_iterator
Definition: aged_container_iterator.h:48
beast::detail::aged_ordered_container< beast::IP::Address >::duration
typename clock_type::duration duration
Definition: aged_ordered_container.h:91
beast::detail::aged_ordered_container::insert
std::enable_if< maybe_multi, iterator >::type insert(const_iterator, value_type &&value)
Definition: aged_ordered_container.h:895
beast::abstract_clock::duration
typename Clock::duration duration
Definition: abstract_clock.h:62
std::allocator_traits::construct
T construct(T... args)
beast::detail::aged_ordered_container::pair_value_compare::aged_ordered_container
friend aged_ordered_container
Definition: aged_ordered_container.h:192
std::cref
T cref(T... args)
beast::detail::aged_ordered_container::KeyValueCompare::KeyValueCompare
KeyValueCompare(Compare const &compare)
Definition: aged_ordered_container.h:217
beast::detail::aged_ordered_container::element::when
time_point when
Definition: aged_ordered_container.h:160
beast::detail::aged_ordered_container::size_type
std::size_t size_type
Definition: aged_ordered_container.h:96
beast::detail::aged_ordered_container::pair_value_compare
Definition: aged_ordered_container.h:164
beast::detail::aged_ordered_container::KeyValueCompare::result_type
bool result_type
Definition: aged_ordered_container.h:212
beast::detail::aged_ordered_container< beast::IP::Address >::key_type
Key key_type
Definition: aged_ordered_container.h:92
initializer_list
beast::detail::aged_ordered_container::touch
void touch(beast::detail::aged_container_iterator< is_const, Iterator, Base > pos)
Definition: aged_ordered_container.h:1009
beast::detail::aged_ordered_container::allocator_type
Allocator allocator_type
Definition: aged_ordered_container.h:453
beast
Definition: base_uint.h:582