42 #ifndef PB_DS_LU_POLICY_HPP
43 #define PB_DS_LU_POLICY_HPP
47 #include <ext/pb_ds/detail/list_update_policy/counter_lu_metadata.hpp>
53 struct null_lu_metadata
56 #define PB_DS_CLASS_T_DEC template<typename Allocator>
57 #define PB_DS_CLASS_C_DEC move_to_front_lu_policy<Allocator>
61 template<
typename Allocator = std::allocator<
char> >
62 class move_to_front_lu_policy
65 typedef Allocator allocator_type;
68 typedef null_lu_metadata metadata_type;
71 typedef typename allocator_type::template rebind<metadata_type>::other metadata_rebind;
72 typedef typename metadata_rebind::reference metadata_reference;
81 operator()(metadata_reference r_metadata)
const;
84 static null_lu_metadata s_metadata;
87 #include <ext/pb_ds/detail/list_update_policy/mtf_lu_policy_imp.hpp>
89 #undef PB_DS_CLASS_T_DEC
90 #undef PB_DS_CLASS_C_DEC
92 #define PB_DS_CLASS_T_DEC template<std::size_t Max_Count, class Allocator>
93 #define PB_DS_CLASS_C_DEC counter_lu_policy<Max_Count, Allocator>
97 template<std::size_t Max_Count = 5,
99 class counter_lu_policy
100 :
private detail::counter_lu_policy_base<typename Allocator::size_type>
103 typedef Allocator allocator_type;
107 max_count = Max_Count
110 typedef typename allocator_type::size_type size_type;
113 typedef detail::counter_lu_metadata<size_type> metadata_type;
116 typedef typename Allocator::template rebind<metadata_type>::other metadata_rebind;
117 typedef typename metadata_rebind::reference metadata_reference;
126 operator()(metadata_reference r_metadata)
const;
129 typedef detail::counter_lu_policy_base<typename Allocator::size_type> base_type;
132 #include <ext/pb_ds/detail/list_update_policy/counter_lu_policy_imp.hpp>
134 #undef PB_DS_CLASS_T_DEC
135 #undef PB_DS_CLASS_C_DEC
The standard allocator, as per [20.4].Further details: http://gcc.gnu.org/onlinedocs/libstdc++/manual...