constructor_destructor_no_store_hash_fn_imps.hpp: Formating fixes.
authorBenjamin Kosnik <bkoz@redhat.com>
Sat, 30 Sep 2006 00:39:20 +0000 (00:39 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Sat, 30 Sep 2006 00:39:20 +0000 (00:39 +0000)
2006-09-29  Benjamin Kosnik  <bkoz@redhat.com>

* include/ext/pb_ds/detail/cc_hash_table_map_/
constructor_destructor_no_store_hash_fn_imps.hpp: Formating fixes.
* include/ext/pb_ds/detail/basic_tree_policy/
null_node_metadata.hpp: Same.
* include/ext/pb_ds/detail/binary_heap_/const_point_iterator.hpp: Same.
* include/ext/pb_ds/detail/basic_types.hpp: Same.
* include/ext/pb_ds/detail/list_update_policy/
mtf_lu_policy_imp.hpp: Same.
* include/ext/pb_ds/detail/list_update_policy/
counter_lu_metadata.hpp: Same.
* include/ext/pb_ds/detail/list_update_policy/
sample_update_policy.hpp: Same.
* include/ext/pb_ds/detail/list_update_policy/
counter_lu_policy_imp.hpp: Same.
* include/ext/pb_ds/list_update_policy.hpp: Same.

From-SVN: r117328

libstdc++-v3/ChangeLog
libstdc++-v3/include/ext/pb_ds/detail/basic_tree_policy/null_node_metadata.hpp
libstdc++-v3/include/ext/pb_ds/detail/basic_types.hpp
libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/const_point_iterator.hpp
libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp
libstdc++-v3/include/ext/pb_ds/detail/list_update_policy/counter_lu_metadata.hpp
libstdc++-v3/include/ext/pb_ds/detail/list_update_policy/counter_lu_policy_imp.hpp
libstdc++-v3/include/ext/pb_ds/detail/list_update_policy/mtf_lu_policy_imp.hpp
libstdc++-v3/include/ext/pb_ds/detail/list_update_policy/sample_update_policy.hpp
libstdc++-v3/include/ext/pb_ds/list_update_policy.hpp

index 9a5de15946d76e2d1536beb0917c515be2d0bfb2..43570848a373806c5804cee61ccd96c2e7f9a61a 100644 (file)
@@ -1,3 +1,21 @@
+2006-09-29  Benjamin Kosnik  <bkoz@redhat.com>
+
+       * include/ext/pb_ds/detail/cc_hash_table_map_/
+       constructor_destructor_no_store_hash_fn_imps.hpp: Formating fixes.
+       * include/ext/pb_ds/detail/basic_tree_policy/
+       null_node_metadata.hpp: Same.
+       * include/ext/pb_ds/detail/binary_heap_/const_point_iterator.hpp: Same.
+--     * include/ext/pb_ds/detail/basic_types.hpp: Same.
+       * include/ext/pb_ds/detail/list_update_policy/
+       mtf_lu_policy_imp.hpp: Same.
+       * include/ext/pb_ds/detail/list_update_policy/
+       counter_lu_metadata.hpp: Same.
+       * include/ext/pb_ds/detail/list_update_policy/
+       sample_update_policy.hpp: Same.
+       * include/ext/pb_ds/detail/list_update_policy/
+       counter_lu_policy_imp.hpp: Same.
+       * include/ext/pb_ds/list_update_policy.hpp: Same.       
+
 2006-09-29  Benjamin Kosnik  <bkoz@redhat.com>
             Howard Hinnant  <hhinnant@apple.com>
             Paolo Carlini  <pcarlini@suse.de>
index 1e050f807ac2445a2a9a5e59d988677d77c441e5..23991987097a7f4bb05fefd8d0dc165fa33fe08d 100644 (file)
@@ -53,31 +53,21 @@ namespace pb_ds
 {
   namespace detail
   {
-
     template<typename Key, class Data, class Allocator>
     struct dumconst_node_iterator
     {
     private:
-      typedef
-      typename types_traits<
-      Key,
-      Data,
-      Allocator,
-      false>::pointer
-      const_iterator;
+      typedef typename types_traits<Key, Data, Allocator, false>::pointer const_iterator;
 
     public:
       typedef const_iterator value_type;
-
       typedef const_iterator const_reference;
-
       typedef const_reference reference;
     };
 
     struct null_node_metadata
     { };
-
   } // namespace detail
 } // namespace pb_ds
 
-#endif // #ifndef PB_DS_NULL_NODE_METADATA_HPP
+#endif 
index 4bad6c04a7fe978703d558f7c364808c560ff509..817ea25b5f2c4385e29c7b9e5c3d1b35510b1237 100644 (file)
@@ -56,64 +56,34 @@ namespace pb_ds
 {
   namespace detail
   {
-
-    template<typename Key, class Mapped, class Allocator, bool Store_Hash>
+    template<typename Key, typename Mapped, typename Allocator, bool Store_Hash>
     struct value_type_base;
 
-#define PB_DS_CLASS_T_DEC                                      \
-    template<typename Key, class Mapped, class Allocator>
+#define PB_DS_CLASS_T_DEC \
+    template<typename Key, typename Mapped, typename Allocator>
 
-#define PB_DS_CLASS_C_DEC                                      \
-    value_type_base<                                           \
-                                               Key,            \
-                                               Mapped,         \
-                                               Allocator,      \
-                                               false>
+#define PB_DS_CLASS_C_DEC \
+    value_type_base<Key, Mapped, Allocator, false>
 
     /**
      * Specialization of value_type_base for the case where the hash value
-     *    is not stored alongside each value.
+     * is not stored alongside each value.
      **/
-    template<typename Key, class Mapped, class Allocator>
-    struct value_type_base<
-      Key,
-      Mapped,
-      Allocator,
-      false>
+    template<typename Key, typename Mapped, typename Allocator>
+    struct value_type_base<Key, Mapped, Allocator, false>
     {
-
-      typedef
-      typename Allocator::template rebind<
-       Mapped>::other
-      mapped_type_allocator;
-
+      typedef typename Allocator::template rebind<Mapped>::other mapped_type_allocator;
       typedef typename mapped_type_allocator::value_type mapped_type;
-
       typedef typename mapped_type_allocator::pointer mapped_pointer;
-
-      typedef
-      typename mapped_type_allocator::const_pointer
-      const_mapped_pointer;
-
+      typedef typename mapped_type_allocator::const_pointer const_mapped_pointer;
       typedef typename mapped_type_allocator::reference mapped_reference;
+      typedef typename mapped_type_allocator::const_reference const_mapped_reference;
 
-      typedef
-      typename mapped_type_allocator::const_reference
-      const_mapped_reference;
-
-      typedef
-      typename Allocator::template rebind<
-       std::pair<const Key, Mapped> >::other
-      value_type_allocator;
-
+      typedef typename Allocator::template rebind<std::pair<const Key, Mapped> >::other value_type_allocator;
       typedef typename value_type_allocator::value_type value_type;
-
       typedef typename value_type_allocator::pointer pointer;
-
       typedef typename value_type_allocator::const_pointer const_pointer;
-
       typedef typename value_type_allocator::reference reference;
-
       typedef typename value_type_allocator::const_reference const_reference;
 
       struct stored_value_type
@@ -123,139 +93,78 @@ namespace pb_ds
     };
 
 #undef PB_DS_CLASS_T_DEC
-
 #undef PB_DS_CLASS_C_DEC
 
-#define PB_DS_CLASS_T_DEC                                      \
-    template<typename Key, class Mapped, class Allocator>
+#define PB_DS_CLASS_T_DEC \
+    template<typename Key, typename Mapped, typename Allocator>
 
-#define PB_DS_CLASS_C_DEC                                      \
-    value_type_base<                                           \
-                                               Key,            \
-                                               Mapped,         \
-                                               Allocator,      \
-                                               true>
+#define PB_DS_CLASS_C_DEC \
+    value_type_base<Key, Mapped, Allocator, true>
 
     /**
      * Specialization of value_type_base for the case where the hash value
-     *    is stored alongside each value.
+     * is stored alongside each value.
      **/
-    template<typename Key, class Mapped, class Allocator>
-    struct value_type_base<
-      Key,
-      Mapped,
-      Allocator,
-      true>
+    template<typename Key, typename Mapped, typename Allocator>
+    struct value_type_base<Key, Mapped, Allocator, true>
     {
-
-      typedef
-      typename Allocator::template rebind<
-       Mapped>::other
-      mapped_type_allocator;
-
+      typedef typename Allocator::template rebind<Mapped>::other mapped_type_allocator;
       typedef typename mapped_type_allocator::value_type mapped_type;
-
       typedef typename mapped_type_allocator::pointer mapped_pointer;
-
-      typedef
-      typename mapped_type_allocator::const_pointer
-      const_mapped_pointer;
-
+      typedef typename mapped_type_allocator::const_pointer const_mapped_pointer;
       typedef typename mapped_type_allocator::reference mapped_reference;
+      typedef typename mapped_type_allocator::const_reference const_mapped_reference;
 
-      typedef
-      typename mapped_type_allocator::const_reference
-      const_mapped_reference;
-
-      typedef
-      typename Allocator::template rebind<
-       std::pair<const Key, Mapped> >::other
-      value_type_allocator;
-
+      typedef typename Allocator::template rebind<std::pair<const Key, Mapped> >::other value_type_allocator;
       typedef typename value_type_allocator::value_type value_type;
-
       typedef typename value_type_allocator::pointer pointer;
-
       typedef typename value_type_allocator::const_pointer const_pointer;
-
       typedef typename value_type_allocator::reference reference;
-
       typedef typename value_type_allocator::const_reference const_reference;
 
       struct stored_value_type
       {
        value_type m_value;
-
        typename Allocator::size_type m_hash;
       };
     };
 
 #undef PB_DS_CLASS_T_DEC
-
 #undef PB_DS_CLASS_C_DEC
 
-#define PB_DS_CLASS_T_DEC                      \
-    template<typename Key, class Allocator>
+#define PB_DS_CLASS_T_DEC \
+    template<typename Key, typename Allocator>
 
-#define PB_DS_CLASS_C_DEC                                              \
-    value_type_base<                                                   \
-                                               Key,                    \
-                                               null_mapped_type,       \
-                                               Allocator,              \
-                                               false>
+#define PB_DS_CLASS_C_DEC \
+    value_type_base<Key, null_mapped_type, Allocator, false>
 
     /**
      * Specialization of value_type_base for the case where the hash value
-     *    is not stored alongside each value.
+     * is not stored alongside each value.
      **/
-    template<typename Key, class Allocator>
-    struct value_type_base<
-      Key,
-      null_mapped_type,
-      Allocator,
-      false>
+    template<typename Key, typename Allocator>
+    struct value_type_base<Key, null_mapped_type, Allocator, false>
     {
-
-      typedef
-      typename Allocator::template rebind<
-       null_mapped_type>::other
-      mapped_type_allocator;
-
+      typedef typename Allocator::template rebind<null_mapped_type>::other mapped_type_allocator;
       typedef typename mapped_type_allocator::value_type mapped_type;
-
       typedef typename mapped_type_allocator::pointer mapped_pointer;
-
-      typedef
-      typename mapped_type_allocator::const_pointer
-      const_mapped_pointer;
-
+      typedef typename mapped_type_allocator::const_pointer const_mapped_pointer;
       typedef typename mapped_type_allocator::reference mapped_reference;
-
-      typedef
-      typename mapped_type_allocator::const_reference
-      const_mapped_reference;
+      typedef typename mapped_type_allocator::const_reference const_mapped_reference;
 
       typedef Key value_type;
 
-      typedef
-      typename Allocator::template rebind<
-       value_type>::other
-      value_type_allocator;
-
+      typedef typename Allocator::template rebind<value_type>::other value_type_allocator;
       typedef typename value_type_allocator::pointer pointer;
-
       typedef typename value_type_allocator::const_pointer const_pointer;
-
       typedef typename value_type_allocator::reference reference;
-
       typedef typename value_type_allocator::const_reference const_reference;
 
       struct stored_value_type
       {
-       Key m_value;
+       value_type m_value;
       };
 
-    public:
       static null_mapped_type s_null_mapped;
     };
 
@@ -263,73 +172,42 @@ namespace pb_ds
     null_mapped_type PB_DS_CLASS_C_DEC::s_null_mapped;
 
 #undef PB_DS_CLASS_T_DEC
-
 #undef PB_DS_CLASS_C_DEC
 
-#define PB_DS_CLASS_T_DEC                      \
-    template<typename Key, class Allocator>
+#define PB_DS_CLASS_T_DEC \
+    template<typename Key, typename Allocator>
 
-#define PB_DS_CLASS_C_DEC                                              \
-    value_type_base<                                                   \
-                                               Key,                    \
-                                               null_mapped_type,       \
-                                               Allocator,              \
-                                               true>
+#define PB_DS_CLASS_C_DEC \
+    value_type_base<Key, null_mapped_type, Allocator, true>
 
     /**
      * Specialization of value_type_base for the case where the hash value
-     *    is stored alongside each value.
+     * is stored alongside each value.
      **/
-    template<typename Key, class Allocator>
-    struct value_type_base<
-      Key,
-      null_mapped_type,
-      Allocator,
-      true>
+    template<typename Key, typename Allocator>
+    struct value_type_base<Key, null_mapped_type, Allocator, true>
     {
-
-      typedef
-      typename Allocator::template rebind<
-       null_mapped_type>::other
-      mapped_type_allocator;
-
+      typedef typename Allocator::template rebind<null_mapped_type>::other mapped_type_allocator;
       typedef typename mapped_type_allocator::value_type mapped_type;
-
       typedef typename mapped_type_allocator::pointer mapped_pointer;
-
-      typedef
-      typename mapped_type_allocator::const_pointer
-      const_mapped_pointer;
-
+      typedef typename mapped_type_allocator::const_pointer const_mapped_pointer;
       typedef typename mapped_type_allocator::reference mapped_reference;
-
-      typedef
-      typename mapped_type_allocator::const_reference
-      const_mapped_reference;
+      typedef typename mapped_type_allocator::const_reference const_mapped_reference;
 
       typedef Key value_type;
 
-      typedef
-      typename Allocator::template rebind<
-       Key>::other
-      value_type_allocator;
-
+      typedef typename Allocator::template rebind<value_type>::other value_type_allocator;
       typedef typename value_type_allocator::pointer pointer;
-
       typedef typename value_type_allocator::const_pointer const_pointer;
-
       typedef typename value_type_allocator::reference reference;
-
       typedef typename value_type_allocator::const_reference const_reference;
 
       struct stored_value_type
       {
-       Key m_value;
-
+       value_type m_value;
        typename Allocator::size_type m_hash;
       };
 
-    public:
       static null_mapped_type s_null_mapped;
     };
 
@@ -337,41 +215,32 @@ namespace pb_ds
     null_mapped_type PB_DS_CLASS_C_DEC::s_null_mapped;
 
 #undef PB_DS_CLASS_T_DEC
-
 #undef PB_DS_CLASS_C_DEC
 
-    template<typename Key, class Mapped>
+    template<typename Key, typename Mapped>
     struct no_throw_copies;
 
-    template<typename Key, class Mapped>
+    template<typename Key, typename Mapped>
     struct no_throw_copies
     {
       typedef
-      integral_constant<int,
-                                      is_simple<Key>::value&& 
-      is_simple<Mapped>::value>
+      integral_constant<int, is_simple<Key>::value && is_simple<Mapped>::value>
       indicator;
     };
 
     template<typename Key>
-    struct no_throw_copies<
-      Key,
-      null_mapped_type>
+    struct no_throw_copies<Key, null_mapped_type>
     {
-      typedef
-      integral_constant<int,
-                                      is_simple<Key>::value>
-      indicator;
+      typedef integral_constant<int, is_simple<Key>::value> indicator;
     };
 
     template<typename Size_Type>
     struct comp_hash_
     {
-      typedef std::pair< Size_Type, Size_Type> comp_hash;
+      typedef std::pair<Size_Type, Size_Type> comp_hash;
     };
-
   } // namespace detail
 } // namespace pb_ds
 
-#endif // #ifndef PB_DS_BASIC_TYPES_HPP
+#endif 
 
index 670b6ecf07b384b47a4bd0ac5f3f75e3b19e465b..3a50cd6c4b1ea1ce6d487fc87decaaadaf5fe21c 100644 (file)
@@ -55,29 +55,15 @@ namespace pb_ds
 {
   namespace detail
   {
-
-#define PB_DS_CLASS_T_DEC \
-    template<typename Value_Type, typename Entry, bool Simple, class Allocator>
-
-#define PB_DS_CLASS_C_DEC \
-    binary_heap_const_point_iterator_<Value_Type, Entry, Simple, Allocator>
-
     // Const point-type iterator.
-    template<typename Value_Type,
-            typename Entry,
-            bool Simple,
-            class Allocator>
+    template<typename Value_Type, typename Entry, bool Simple, 
+            typename Allocator>
     class binary_heap_const_point_iterator_
     {
-
     protected:
-      typedef
-      typename Allocator::template rebind<
-      Entry>::other::pointer
-      entry_pointer;
+      typedef typename Allocator::template rebind<Entry>::other::pointer entry_pointer;
 
     public:
-
       // Category.
       typedef trivial_iterator_tag iterator_category;
 
@@ -88,31 +74,24 @@ namespace pb_ds
       typedef Value_Type value_type;
 
       // Iterator's pointer type.
-      typedef
-      typename Allocator::template rebind<
-       value_type>::other::pointer
+      typedef typename Allocator::template rebind<value_type>::other::pointer
       pointer;
 
       // Iterator's const pointer type.
       typedef
-      typename Allocator::template rebind<
-       value_type>::other::const_pointer
+      typename Allocator::template rebind<value_type>::other::const_pointer
       const_pointer;
 
       // Iterator's reference type.
       typedef
-      typename Allocator::template rebind<
-       value_type>::other::reference
+      typename Allocator::template rebind<value_type>::other::reference
       reference;
 
       // Iterator's const reference type.
       typedef
-      typename Allocator::template rebind<
-       value_type>::other::const_reference
+      typename Allocator::template rebind<value_type>::other::const_reference
       const_reference;
 
-    public:
-
       inline
       binary_heap_const_point_iterator_(entry_pointer p_e) : m_p_e(p_e)
       { }
@@ -123,7 +102,7 @@ namespace pb_ds
 
       // Copy constructor.
       inline
-      binary_heap_const_point_iterator_(const PB_DS_CLASS_C_DEC& other)
+      binary_heap_const_point_iterator_(const binary_heap_const_point_iterator_& other)
       : m_p_e(other.m_p_e)
       { }
 
@@ -132,7 +111,7 @@ namespace pb_ds
       operator->() const
       {
        _GLIBCXX_DEBUG_ASSERT(m_p_e != NULL);
-       return to_ptr(integral_constant<int,Simple>());
+       return to_ptr(integral_constant<int, Simple>());
       }
 
       // Access.
@@ -140,17 +119,17 @@ namespace pb_ds
       operator*() const
       {
        _GLIBCXX_DEBUG_ASSERT(m_p_e != NULL);
-       return *to_ptr(integral_constant<int,Simple>());
+       return *to_ptr(integral_constant<int, Simple>());
       }
 
       // Compares content to a different iterator object.
       inline bool
-      operator==(const PB_DS_CLASS_C_DEC& other) const
+      operator==(const binary_heap_const_point_iterator_& other) const
       { return m_p_e == other.m_p_e; }
 
       // Compares content (negatively) to a different iterator object.
       inline bool
-      operator!=(const PB_DS_CLASS_C_DEC& other) const
+      operator!=(const binary_heap_const_point_iterator_& other) const
       { return m_p_e != other.m_p_e; }
 
     private:
@@ -165,10 +144,6 @@ namespace pb_ds
     public:
       entry_pointer m_p_e;
     };
-
-#undef PB_DS_CLASS_T_DEC
-#undef PB_DS_CLASS_C_DEC
-
   } // namespace detail
 } // namespace pb_ds
 
index 6aac3795c1ece1982aebab9f4be1a3ff0a3e4486..f2b41b37bca63c9a3ff1a2e1e2ebe6f98887b471 100644 (file)
@@ -48,7 +48,8 @@
 PB_DS_CLASS_T_DEC
 inline void
 PB_DS_CLASS_C_DEC::
-constructor_insert_new_imp(const_mapped_reference r_val, size_type pos, integral_constant<int,false>)
+constructor_insert_new_imp(const_mapped_reference r_val, size_type pos, 
+                          false_type)
 {
   // Following lines might throw an exception.
   entry_pointer p = get_entry(r_val, traits_base::s_no_throw_copies_indicator);
index 744f72b48ca066a5efc3fb4f2a53ed056cdce408..d8cd28916831a57163d1f6a3f7004c8a30043b07 100644 (file)
@@ -48,81 +48,45 @@ namespace pb_ds
 {
   namespace detail
   {
-
     template<typename Size_Type>
     class counter_lu_policy_base;
 
-    // A list-update metadata type that moves elements to the front of the list based on the counter algorithm.
+    // A list-update metadata type that moves elements to the front of
+    // the list based on the counter algorithm.
     template<typename Size_Type = size_t>
     class counter_lu_metadata
     {
-
     public:
-
       typedef Size_Type size_type;
 
     private:
       counter_lu_metadata(size_type init_count) : m_count(init_count)
       { }
 
-    private:
-      mutable size_type m_count;
+      friend class counter_lu_policy_base<size_type>;
 
-      friend class counter_lu_policy_base<Size_Type>;
+      mutable size_type m_count;
     };
 
-    template<typename Size_Type>
-    class counter_lu_policy_base;
-
-#define PB_DS_CLASS_T_DEC                      \
-    template<typename Size_Type>
-
-#define PB_DS_CLASS_C_DEC                                      \
-    counter_lu_policy_base<                                    \
-                                               Size_Type>
-
     template<typename Size_Type>
     class counter_lu_policy_base
     {
     protected:
       typedef Size_Type size_type;
 
-    protected:
-      counter_lu_metadata<
-      Size_Type>
-      operator()(size_type max_size) const;
+      counter_lu_metadata<size_type>
+      operator()(size_type max_size) const
+      { return counter_lu_metadata<Size_Type>(rand() % max_size); }
 
       template<typename Metadata_Reference>
       bool
-      operator()(Metadata_Reference r_data, size_type m_max_count) const;
+      operator()(Metadata_Reference r_data, size_type m_max_count) const
+      {
+       if (++r_data.m_count != m_max_count)
+         return false;
+       r_data.m_count = 0;
+       return true;
+      }
     };
-
-    PB_DS_CLASS_T_DEC
-    counter_lu_metadata<
-      Size_Type>
-    PB_DS_CLASS_C_DEC::
-    operator()(size_type m_max_count) const
-    {
-      return (counter_lu_metadata<Size_Type>(rand() % m_max_count));
-    }
-
-    PB_DS_CLASS_T_DEC
-    template<typename Metadata_Reference>
-    inline bool
-    PB_DS_CLASS_C_DEC::
-    operator()(Metadata_Reference r_data, size_type m_max_count) const
-    {
-      if (++r_data.m_count != m_max_count)
-       return (false);
-
-      r_data.m_count = 0;
-
-      return (true);
-    }
-
   } // namespace detail
 } // namespace pb_ds
-
-#undef PB_DS_CLASS_T_DEC
-
-#undef PB_DS_CLASS_C_DEC
index 2d0521ab1f8f575a17332f02de0dece6a7faf933..42e1bdf2836c353b923ecf1b1d45083b41eb2b1b 100644 (file)
  */
 
 PB_DS_CLASS_T_DEC
-detail::counter_lu_metadata<
-  typename Allocator::size_type>
+detail::counter_lu_metadata<typename Allocator::size_type>
 PB_DS_CLASS_C_DEC::
 operator()() const
-{
-  return (base_type::operator()(max_count));
-}
+{ return (base_type::operator()(max_count)); }
 
 PB_DS_CLASS_T_DEC
 bool
 PB_DS_CLASS_C_DEC::
 operator()(metadata_reference r_data) const
-{
-  return (base_type::operator()(r_data, max_count));
-}
+{ return (base_type::operator()(r_data, max_count)); }
index 0a6180cd558e69f6e3fdd8d448d99a9c15268d8e..8f9d9460df21081a49e47f8ec2d18c8dc69168e6 100644 (file)
@@ -51,15 +51,11 @@ PB_DS_CLASS_T_DEC
 typename PB_DS_CLASS_C_DEC::metadata_type
 PB_DS_CLASS_C_DEC::
 operator()() const
-{
-  return s_metadata;
-}
+{ return s_metadata; }
 
 PB_DS_CLASS_T_DEC
 inline bool
 PB_DS_CLASS_C_DEC::
 operator()(metadata_reference /*r_data*/) const
-{
-  return true;
-}
+{ return true; }
 
index d16a629424e6b37cf4f9f7228c8a991087026fda..8cfc1f2310d1692784a0cc9db51a2c9089b723c8 100644 (file)
 #define PB_DS_SAMPLE_UPDATE_POLICY_HPP
 
 // A sample list-update policy.
-class sample_update_policy
+struct sample_update_policy
 {
-
-public:
-
   // Default constructor.
   sample_update_policy();
 
   // Copy constructor.
-  sample_update_policy(const sample_update_policy& other);
+  sample_update_policy(const sample_update_policy&);
 
   // Swaps content.
   inline void
   swap(sample_update_policy& other);
 
 protected:
-
   // Metadata on which this functor operates.
   typedef some_metadata_type metadata_type;
 
-protected:
-
   // Creates a metadata object.
   metadata_type
   operator()() const;
 
-  // Decides whether a metadata object should be moved to the front of the list. A list-update based containers object will call this method to decide whether to move a node to the front of the list. The method shoule return true if the node should be moved to the front of the list.
+  // Decides whether a metadata object should be moved to the front of
+  // the list. A list-update based containers object will call this
+  // method to decide whether to move a node to the front of the
+  // list. The method shoule return true if the node should be moved
+  // to the front of the list.
   bool
-  operator()(metadata_reference r_data) const;
-
+  operator()(metadata_reference) const;
 };
 
-#endif // #ifndef PB_DS_SAMPLE_UPDATE_POLICY_HPP
+#endif 
index 0ddd1af71f32e975a25cebb5017cf19d8e01ac10..cfe2a2c375e105269a3b5f68c05e11ffda573ed5 100644 (file)
@@ -78,7 +78,8 @@ namespace pb_ds
     metadata_type
     operator()() const;
       
-    // Decides whether a metadata object should be moved to the front of the list.
+    // Decides whether a metadata object should be moved to the front
+    // of the list.
     inline bool
     operator()(metadata_reference r_metadata) const;
       
@@ -94,7 +95,8 @@ namespace pb_ds
 #define PB_DS_CLASS_T_DEC template<size_t Max_Count, class Allocator>
 #define PB_DS_CLASS_C_DEC counter_lu_policy<Max_Count, Allocator>
 
-  // A list-update policy that moves elements to the front of the list based on the counter algorithm.
+  // A list-update policy that moves elements to the front of the list
+  // based on the counter algorithm.
   template<size_t Max_Count = 5, typename Allocator = std::allocator<char> >
   class counter_lu_policy 
   : private detail::counter_lu_policy_base<typename Allocator::size_type>
@@ -120,7 +122,8 @@ namespace pb_ds
     metadata_type
     operator()() const;
 
-    // Decides whether a metadata object should be moved to the front of the list.
+    // Decides whether a metadata object should be moved to the front
+    // of the list.
     bool
     operator()(metadata_reference r_metadata) const;