41 #ifndef PB_DS_LU_POLICY_HPP
42 #define PB_DS_LU_POLICY_HPP
45 #include <ext/pb_ds/detail/list_update_policy/counter_lu_metadata.hpp>
51 struct null_lu_metadata
54 #define PB_DS_CLASS_T_DEC template<typename Allocator>
55 #define PB_DS_CLASS_C_DEC move_to_front_lu_policy<Allocator>
59 template<
typename Allocator = std::allocator<
char> >
60 class move_to_front_lu_policy
63 typedef Allocator allocator_type;
66 typedef null_lu_metadata metadata_type;
69 typedef typename allocator_type::template rebind<metadata_type>::other metadata_rebind;
70 typedef typename metadata_rebind::reference metadata_reference;
79 operator()(metadata_reference r_metadata)
const;
82 static null_lu_metadata s_metadata;
85 #include <ext/pb_ds/detail/list_update_policy/mtf_lu_policy_imp.hpp>
87 #undef PB_DS_CLASS_T_DEC
88 #undef PB_DS_CLASS_C_DEC
90 #define PB_DS_CLASS_T_DEC template<size_t Max_Count, class Allocator>
91 #define PB_DS_CLASS_C_DEC counter_lu_policy<Max_Count, Allocator>
95 template<
size_t Max_Count = 5,
typename Allocator = std::allocator<
char> >
96 class counter_lu_policy
97 :
private detail::counter_lu_policy_base<typename Allocator::size_type>
100 typedef Allocator allocator_type;
104 max_count = Max_Count
107 typedef typename allocator_type::size_type size_type;
110 typedef detail::counter_lu_metadata<size_type> metadata_type;
113 typedef typename Allocator::template rebind<metadata_type>::other metadata_rebind;
114 typedef typename metadata_rebind::reference metadata_reference;
123 operator()(metadata_reference r_metadata)
const;
126 typedef detail::counter_lu_policy_base<typename Allocator::size_type> base_type;
129 #include <ext/pb_ds/detail/list_update_policy/counter_lu_policy_imp.hpp>
131 #undef PB_DS_CLASS_T_DEC
132 #undef PB_DS_CLASS_C_DEC
GNU extensions for policy-based data structures for public use.