hash_load_check_resize_trigger_imp.hpp (assert_valid): Replace _GLIBCXX_DEBUG_ASSERT...
authorFrançois Dumont <francois.cppdevs@free.fr>
Wed, 11 May 2011 19:29:02 +0000 (21:29 +0200)
committerFrançois Dumont <fdumont@gcc.gnu.org>
Wed, 11 May 2011 19:29:02 +0000 (19:29 +0000)
2011-05-11  François Dumont  <francois.cppdevs@free.fr>

        * include/ext/pb_ds/detail/resize_policy/
        hash_load_check_resize_trigger_imp.hpp (assert_valid): Replace
        _GLIBCXX_DEBUG_ASSERT calls with PB_DS_DEBUG_VERIFY.
        * include/ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp,
        find_fn_imps.hpp, insert_fn_imps.hpp, binomial_heap_base_.hpp,
        constructors_destructor_fn_imps.hpp, split_join_fn_imps.hpp
        (PB_DS_ASSERT_VALID): Rename in PB_DS_ASSERT_VALID_COND.
        * include/ext/pb_ds/detail/debug_map_base.hpp,
        splay_tree_/splay_tree_.hpp, ov_tree_map_/ov_tree_map_.hpp,
        cc_hash_table_map_/cc_ht_map_.hpp, pat_trie_/pat_trie_.hpp,
        leaf.hpp, internal_node.hpp, gp_hash_table_map_/gp_ht_map_.hpp,
        bin_search_tree_/bin_search_tree_.hpp, list_update_map_/lu_map_.hpp,
        rb_tree_map_/rb_tree_.hpp (PB_DS_ASSERT_VALID, PB_DS_DEBUG_VERIFY,
        PB_DS_CHECK_KEY_EXISTS, PB_DS_CHECK_KEY_DOES_NOT_EXIST): Duplicate
        macro definitions move...
        * include/ext/pb_ds/detail/container_base_dispatch.hpp: ... here...
        * include/ext/pb_ds/detail/basic_tree_policy/traits.hpp: ... and here.
        * include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp,
        resize_policy.hpp, pairing_heap_/pairing_heap_.hpp,
        left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp,
        binomial_heap_/binomial_heap_.hpp, thin_heap_/thin_heap_.hpp,
        rc_binomial_heap_/rc_binomial_heap_.hpp, rc.hpp (PB_DS_ASSERT_VALID,
        PB_DS_DEBUG_VERIFY): Duplicate macro definitions move...
        * include/ext/pb_ds/detail/priority_queue_base_dispatch.hpp:
        ...here.

From-SVN: r173670

30 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/include/ext/pb_ds/detail/basic_tree_policy/traits.hpp
libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.hpp
libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp
libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/resize_policy.hpp
libstdc++-v3/include/ext/pb_ds/detail/binomial_heap_/binomial_heap_.hpp
libstdc++-v3/include/ext/pb_ds/detail/binomial_heap_base_/binomial_heap_base_.hpp
libstdc++-v3/include/ext/pb_ds/detail/binomial_heap_base_/constructors_destructor_fn_imps.hpp
libstdc++-v3/include/ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp
libstdc++-v3/include/ext/pb_ds/detail/binomial_heap_base_/find_fn_imps.hpp
libstdc++-v3/include/ext/pb_ds/detail/binomial_heap_base_/insert_fn_imps.hpp
libstdc++-v3/include/ext/pb_ds/detail/binomial_heap_base_/split_join_fn_imps.hpp
libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp
libstdc++-v3/include/ext/pb_ds/detail/container_base_dispatch.hpp
libstdc++-v3/include/ext/pb_ds/detail/debug_map_base.hpp
libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp
libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp
libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/lu_map_.hpp
libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp
libstdc++-v3/include/ext/pb_ds/detail/pairing_heap_/pairing_heap_.hpp
libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/internal_node.hpp
libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/leaf.hpp
libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp
libstdc++-v3/include/ext/pb_ds/detail/priority_queue_base_dispatch.hpp
libstdc++-v3/include/ext/pb_ds/detail/rb_tree_map_/rb_tree_.hpp
libstdc++-v3/include/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp
libstdc++-v3/include/ext/pb_ds/detail/rc_binomial_heap_/rc_binomial_heap_.hpp
libstdc++-v3/include/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_imp.hpp
libstdc++-v3/include/ext/pb_ds/detail/splay_tree_/splay_tree_.hpp
libstdc++-v3/include/ext/pb_ds/detail/thin_heap_/thin_heap_.hpp

index 0ba711832dc7854a1ed6133af0189f0f16b55b4b..661fed45dad7c84227167ad5fd334534e54fa2ad 100644 (file)
@@ -1,3 +1,31 @@
+2011-05-11  François Dumont  <francois.cppdevs@free.fr>
+
+       * include/ext/pb_ds/detail/resize_policy/
+       hash_load_check_resize_trigger_imp.hpp (assert_valid): Replace
+       _GLIBCXX_DEBUG_ASSERT calls with PB_DS_DEBUG_VERIFY.
+       * include/ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp,
+       find_fn_imps.hpp, insert_fn_imps.hpp, binomial_heap_base_.hpp,
+       constructors_destructor_fn_imps.hpp, split_join_fn_imps.hpp
+       (PB_DS_ASSERT_VALID): Rename in PB_DS_ASSERT_VALID_COND.
+       * include/ext/pb_ds/detail/debug_map_base.hpp,
+       splay_tree_/splay_tree_.hpp, ov_tree_map_/ov_tree_map_.hpp,
+       cc_hash_table_map_/cc_ht_map_.hpp, pat_trie_/pat_trie_.hpp,
+       leaf.hpp, internal_node.hpp, gp_hash_table_map_/gp_ht_map_.hpp,
+       bin_search_tree_/bin_search_tree_.hpp, list_update_map_/lu_map_.hpp,
+       rb_tree_map_/rb_tree_.hpp (PB_DS_ASSERT_VALID, PB_DS_DEBUG_VERIFY,
+       PB_DS_CHECK_KEY_EXISTS, PB_DS_CHECK_KEY_DOES_NOT_EXIST): Duplicate
+       macro definitions move...
+       * include/ext/pb_ds/detail/container_base_dispatch.hpp: ... here...
+       * include/ext/pb_ds/detail/basic_tree_policy/traits.hpp: ... and here.
+       * include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp,
+       resize_policy.hpp, pairing_heap_/pairing_heap_.hpp,
+       left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp,
+       binomial_heap_/binomial_heap_.hpp, thin_heap_/thin_heap_.hpp,
+       rc_binomial_heap_/rc_binomial_heap_.hpp, rc.hpp (PB_DS_ASSERT_VALID,
+       PB_DS_DEBUG_VERIFY): Duplicate macro definitions move...
+       * include/ext/pb_ds/detail/priority_queue_base_dispatch.hpp:
+       ...here.
+
 2011-05-09  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR libstdc++/48933
index b30829a81343448dddb0b8aace7e0a83ad89e77a..d245127c875c1d6e6ba41aea14bff00e5c4fa770 100644 (file)
 #ifndef PB_DS_NODE_AND_IT_TRAITS_HPP
 #define PB_DS_NODE_AND_IT_TRAITS_HPP
 
+#define PB_DS_DEBUG_VERIFY(_Cond)                                      \
+  _GLIBCXX_DEBUG_VERIFY_AT(_Cond,                                      \
+                          _M_message(#_Cond" assertion from %1;:%2;")  \
+                          ._M_string(__FILE__)._M_integer(__LINE__)    \
+                          ,__file,__line)
+
 #include <ext/pb_ds/detail/types_traits.hpp>
 #include <ext/pb_ds/detail/bin_search_tree_/traits.hpp>
 #include <ext/pb_ds/detail/tree_policy/node_metadata_selector.hpp>
@@ -81,5 +87,6 @@ namespace __gnu_pbds
 #include <ext/pb_ds/detail/splay_tree_/traits.hpp>
 #include <ext/pb_ds/detail/ov_tree_map_/traits.hpp>
 #include <ext/pb_ds/detail/pat_trie_/traits.hpp>
+#undef PB_DS_DEBUG_VERIFY
 
 #endif // #ifndef PB_DS_NODE_AND_IT_TRAITS_HPP
index 8be0f80c5b2c6229a936b8f632e9caf21376f9ca..a73414a0fcc59cce9d6c79d2ece6dacdb1abbe1b 100644 (file)
@@ -471,28 +471,12 @@ namespace __gnu_pbds
       static node_allocator s_node_allocator;
     };
 
-#define PB_DS_ASSERT_VALID(X)                                          \
-  _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);)
-
 #define PB_DS_STRUCT_ONLY_ASSERT_VALID(X)                              \
   _GLIBCXX_DEBUG_ONLY(X.structure_only_assert_valid(__FILE__, __LINE__);)
 
 #define PB_DS_ASSERT_NODE_CONSISTENT(_Node)                            \
   _GLIBCXX_DEBUG_ONLY(assert_node_consistent(_Node, __FILE__, __LINE__);)
 
-#define PB_DS_CHECK_KEY_EXISTS(_Key)                                   \
-  _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(_Key, __FILE__, __LINE__);)
-
-#define PB_DS_CHECK_KEY_DOES_NOT_EXIST(_Key)                           \
-  _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(_Key,       \
-                                                          __FILE__, __LINE__);)
-
-#define PB_DS_DEBUG_VERIFY(_Cond)                                      \
-  _GLIBCXX_DEBUG_VERIFY_AT(_Cond,                                      \
-                          _M_message(#_Cond" assertion from %1;:%2;")  \
-                          ._M_string(__FILE__)._M_integer(__LINE__)    \
-                          ,__file,__line)
-
 #include <ext/pb_ds/detail/bin_search_tree_/constructors_destructor_fn_imps.hpp>
 #include <ext/pb_ds/detail/bin_search_tree_/iterators_fn_imps.hpp>
 #include <ext/pb_ds/detail/bin_search_tree_/debug_fn_imps.hpp>
@@ -504,12 +488,8 @@ namespace __gnu_pbds
 #include <ext/pb_ds/detail/bin_search_tree_/rotate_fn_imps.hpp>
 #include <ext/pb_ds/detail/bin_search_tree_/policy_access_fn_imps.hpp>
 
-#undef PB_DS_DEBUG_VERIFY
-#undef PB_DS_CHECK_KEY_DOES_NOT_EXIST
-#undef PB_DS_CHECK_KEY_EXISTS
 #undef PB_DS_ASSERT_NODE_CONSISTENT
 #undef PB_DS_STRUCT_ONLY_ASSERT_VALID
-#undef PB_DS_ASSERT_VALID
 #undef PB_DS_CLASS_C_DEC
 #undef PB_DS_CLASS_T_DEC
 #undef PB_DS_CLASS_NAME
index e728e20c6c13fd36d0860f46682d2844bb1aaddc..4d65d2b6826c5662d9075a3ac481484ef7e49353 100644 (file)
@@ -335,15 +335,6 @@ namespace __gnu_pbds
       entry_pointer m_a_entries;
     };
 
-#define PB_DS_ASSERT_VALID(X) \
-  _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);)
-
-#define PB_DS_DEBUG_VERIFY(_Cond)                                      \
-  _GLIBCXX_DEBUG_VERIFY_AT(_Cond,                                      \
-                          _M_message(#_Cond" assertion from %1;:%2;")  \
-                          ._M_string(__FILE__)._M_integer(__LINE__)    \
-                          ,__file,__line)
-
 #include <ext/pb_ds/detail/binary_heap_/insert_fn_imps.hpp>
 #include <ext/pb_ds/detail/binary_heap_/constructors_destructor_fn_imps.hpp>
 #include <ext/pb_ds/detail/binary_heap_/iterators_fn_imps.hpp>
@@ -355,8 +346,6 @@ namespace __gnu_pbds
 #include <ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp>
 #include <ext/pb_ds/detail/binary_heap_/policy_access_fn_imps.hpp>
 
-#undef PB_DS_DEBUG_VERIFY
-#undef PB_DS_ASSERT_VALID
 #undef PB_DS_CLASS_C_DEC
 #undef PB_DS_CLASS_T_DEC
 #undef PB_DS_ENTRY_CMP_DEC
index e1961272f732f03aa49155f80165f9a0bb1d82b8..c5893872e5c54697722138c8b121fd0b5eb49cb8 100644 (file)
@@ -52,15 +52,6 @@ namespace __gnu_pbds
 
 #define PB_DS_CLASS_C_DEC resize_policy<Size_Type>
 
-#define PB_DS_ASSERT_VALID(X)\
-  _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);)
-
-#define PB_DS_DEBUG_VERIFY(_Cond)                                      \
-  _GLIBCXX_DEBUG_VERIFY_AT(_Cond,                                      \
-                          _M_message(#_Cond" assertion from %1;:%2;")  \
-                          ._M_string(__FILE__)._M_integer(__LINE__)    \
-                          ,__file,__line)
-
     template<typename Size_Type>
     class resize_policy
     {
@@ -253,8 +244,6 @@ namespace __gnu_pbds
     }
 #endif 
 
-#undef PB_DS_DEBUG_VERIFY
-#undef PB_DS_ASSERT_VALID
 #undef PB_DS_CLASS_T_DEC
 #undef PB_DS_CLASS_C_DEC
 
index c618a555afebb7a61c3adf6d97831cc16cfc47d3..a6d6098fd37c7e1ee45a9146589dff6da85f6b33 100644 (file)
@@ -104,13 +104,9 @@ namespace __gnu_pbds
 #endif 
     };
 
-#define PB_DS_ASSERT_VALID(X)                                          \
-  _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);)
-
 #include <ext/pb_ds/detail/binomial_heap_/constructors_destructor_fn_imps.hpp>
 #include <ext/pb_ds/detail/binomial_heap_/debug_fn_imps.hpp>
 
-#undef PB_DS_ASSERT_VALID
 #undef PB_DS_CLASS_C_DEC
 
 #undef PB_DS_CLASS_T_DEC
index 0a1af721e10730def3fed66aff9e8310e1f2b3a1..b2add18e7a0475142ac1c72ea62964020f0658af 100644 (file)
@@ -217,19 +217,13 @@ namespace __gnu_pbds
       node_pointer m_p_max;
     };
 
-#define PB_DS_ASSERT_VALID(X, _StrictlyBinomial)                       \
+#define PB_DS_ASSERT_VALID_COND(X, _StrictlyBinomial)                  \
   _GLIBCXX_DEBUG_ONLY(X.assert_valid(_StrictlyBinomial,__FILE__, __LINE__);)
 
 #define PB_DS_ASSERT_BASE_NODE_CONSISTENT(_Node, _Bool)                        \
   _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(_Node, _Bool,  \
                                                        __FILE__, __LINE__);)
 
-#define PB_DS_DEBUG_VERIFY(_Cond)                                      \
-  _GLIBCXX_DEBUG_VERIFY_AT(_Cond,                                      \
-                          _M_message(#_Cond" assertion from %1;:%2;")  \
-                          ._M_string(__FILE__)._M_integer(__LINE__)    \
-                          ,__file,__line)
-
 #include <ext/pb_ds/detail/binomial_heap_base_/constructors_destructor_fn_imps.hpp>
 #include <ext/pb_ds/detail/binomial_heap_base_/debug_fn_imps.hpp>
 #include <ext/pb_ds/detail/binomial_heap_base_/find_fn_imps.hpp>
@@ -237,9 +231,8 @@ namespace __gnu_pbds
 #include <ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp>
 #include <ext/pb_ds/detail/binomial_heap_base_/split_join_fn_imps.hpp>
 
-#undef PB_DS_DEBUG_VERIFY
 #undef PB_DS_ASSERT_BASE_NODE_CONSISTENT
-#undef PB_DS_ASSERT_VALID
+#undef PB_DS_ASSERT_VALID_COND
 #undef PB_DS_CLASS_C_DEC
 #undef PB_DS_CLASS_T_DEC
 #undef PB_DS_BASE_C_DEC
index 3e6df18ddcaca6c14c3e8ae270c12fe3d1b9e35f..fa86c230cd2da1a11f8827b8e856e95b6eb4fb2a 100644 (file)
@@ -47,7 +47,7 @@ copy_from_range(It first_it, It last_it)
   while (first_it != last_it)
     push(*(first_it++));
 
-  PB_DS_ASSERT_VALID((*this),false)
+  PB_DS_ASSERT_VALID_COND((*this),false)
 }
 
 PB_DS_CLASS_T_DEC
@@ -55,7 +55,7 @@ PB_DS_CLASS_C_DEC::
 binomial_heap_base_() :
   m_p_max(0)
 {
-  PB_DS_ASSERT_VALID((*this),false)
+  PB_DS_ASSERT_VALID_COND((*this),false)
 }
 
 PB_DS_CLASS_T_DEC
@@ -64,7 +64,7 @@ binomial_heap_base_(const Cmp_Fn& r_cmp_fn) :
   PB_DS_BASE_C_DEC(r_cmp_fn),
   m_p_max(0)
 {
-  PB_DS_ASSERT_VALID((*this),false)
+  PB_DS_ASSERT_VALID_COND((*this),false)
 }
 
 PB_DS_CLASS_T_DEC
@@ -73,7 +73,7 @@ binomial_heap_base_(const PB_DS_CLASS_C_DEC& other) :
   PB_DS_BASE_C_DEC(other),
   m_p_max(0)
 {
-  PB_DS_ASSERT_VALID((*this),false)
+  PB_DS_ASSERT_VALID_COND((*this),false)
 }
 
 PB_DS_CLASS_T_DEC
@@ -81,13 +81,13 @@ void
 PB_DS_CLASS_C_DEC::
 swap(PB_DS_CLASS_C_DEC& other)
 {
-  PB_DS_ASSERT_VALID((*this),false)
+  PB_DS_ASSERT_VALID_COND((*this),false)
 
   base_type::swap(other);
 
   std::swap(m_p_max, other.m_p_max);
 
-  PB_DS_ASSERT_VALID((*this),false)
+  PB_DS_ASSERT_VALID_COND((*this),false)
 }
 
 PB_DS_CLASS_T_DEC
index 05c8e075b17bc27f5a688df56337f08bacb89ba5..e7a2dc4f6fdc46b8343a16cfac6c0fb1c25d6808 100644 (file)
@@ -43,7 +43,7 @@ void
 PB_DS_CLASS_C_DEC::
 pop()
 {
-  PB_DS_ASSERT_VALID((*this),true)
+  PB_DS_ASSERT_VALID_COND((*this),true)
   _GLIBCXX_DEBUG_ASSERT(!base_type::empty());
 
   if (m_p_max == 0)
@@ -59,7 +59,7 @@ pop()
 
   m_p_max = 0;
 
-  PB_DS_ASSERT_VALID((*this),true)
+  PB_DS_ASSERT_VALID_COND((*this),true)
 }
 
 PB_DS_CLASS_T_DEC
@@ -113,7 +113,7 @@ void
 PB_DS_CLASS_C_DEC::
 erase(point_iterator it)
 {
-  PB_DS_ASSERT_VALID((*this),true)
+  PB_DS_ASSERT_VALID_COND((*this),true)
   _GLIBCXX_DEBUG_ASSERT(!base_type::empty());
 
   base_type::bubble_to_top(it.m_p_nd);
@@ -124,7 +124,7 @@ erase(point_iterator it)
 
   m_p_max = 0;
 
-  PB_DS_ASSERT_VALID((*this),true)
+  PB_DS_ASSERT_VALID_COND((*this),true)
 }
 
 PB_DS_CLASS_T_DEC
@@ -133,11 +133,11 @@ typename PB_DS_CLASS_C_DEC::size_type
 PB_DS_CLASS_C_DEC::
 erase_if(Pred pred)
 {
-  PB_DS_ASSERT_VALID((*this),true)
+  PB_DS_ASSERT_VALID_COND((*this),true)
 
   if (base_type::empty())
     {
-      PB_DS_ASSERT_VALID((*this),true)
+      PB_DS_ASSERT_VALID_COND((*this),true)
 
       return 0;
     }
@@ -185,7 +185,7 @@ erase_if(Pred pred)
 
   m_p_max = 0;
 
-  PB_DS_ASSERT_VALID((*this),true)
+  PB_DS_ASSERT_VALID_COND((*this),true)
 
   return ersd;
 }
index 3f300dca290d9991e8af38cafd15b380c47b0f05..f832cb60c7d9fe3f5cb7a1eaf9f854f4cef33baf 100644 (file)
@@ -43,7 +43,7 @@ inline typename PB_DS_CLASS_C_DEC::const_reference
 PB_DS_CLASS_C_DEC::
 top() const
 {
-  PB_DS_ASSERT_VALID((*this),false)
+  PB_DS_ASSERT_VALID_COND((*this),false)
   _GLIBCXX_DEBUG_ASSERT(!base_type::empty());
 
   if (m_p_max == 0)
index 2d40cd4fd154bd94269a8cb897b8ac7790ed2a1f..11bd5e1444f946f4dc2575e01c3ee65602843a3a 100644 (file)
@@ -43,7 +43,7 @@ inline typename PB_DS_CLASS_C_DEC::point_iterator
 PB_DS_CLASS_C_DEC::
 push(const_reference r_val)
 {
-  PB_DS_ASSERT_VALID((*this),true)
+  PB_DS_ASSERT_VALID_COND((*this),true)
 
   node_pointer p_nd = base_type::get_new_node_for_insert(r_val);
 
@@ -51,7 +51,7 @@ push(const_reference r_val)
 
   m_p_max = 0;
 
-  PB_DS_ASSERT_VALID((*this),true)
+  PB_DS_ASSERT_VALID_COND((*this),true)
 
   return point_iterator(p_nd);
 }
@@ -171,7 +171,7 @@ void
 PB_DS_CLASS_C_DEC::
 modify(point_iterator it, const_reference r_new_val)
 {
-  PB_DS_ASSERT_VALID((*this),true)
+  PB_DS_ASSERT_VALID_COND((*this),true)
   node_pointer p_nd = it.m_p_nd;
 
   _GLIBCXX_DEBUG_ASSERT(p_nd != 0);
@@ -198,7 +198,7 @@ modify(point_iterator it, const_reference r_new_val)
 
       m_p_max = 0;
 
-      PB_DS_ASSERT_VALID((*this),true)
+      PB_DS_ASSERT_VALID_COND((*this),true)
 
         return;
     }
@@ -211,6 +211,6 @@ modify(point_iterator it, const_reference r_new_val)
 
   m_p_max = 0;
 
-  PB_DS_ASSERT_VALID((*this),true)
+  PB_DS_ASSERT_VALID_COND((*this),true)
 }
 
index 405e59385ddd4d3d9d21f5acd5d10e18ce2c4621..6564c54a21ae1d161a479cd5010e5fc6f3a65b6b 100644 (file)
@@ -44,15 +44,15 @@ void
 PB_DS_CLASS_C_DEC::
 split(Pred pred, PB_DS_CLASS_C_DEC& other)
 {
-  PB_DS_ASSERT_VALID((*this),true)
-  PB_DS_ASSERT_VALID(other,true)
+  PB_DS_ASSERT_VALID_COND((*this),true)
+  PB_DS_ASSERT_VALID_COND(other,true)
 
   other.clear();
 
   if (base_type::empty())
     {
-      PB_DS_ASSERT_VALID((*this),true)
-      PB_DS_ASSERT_VALID(other,true)
+      PB_DS_ASSERT_VALID_COND((*this),true)
+      PB_DS_ASSERT_VALID_COND(other,true)
 
       return;
     }
@@ -86,7 +86,7 @@ split(Pred pred, PB_DS_CLASS_C_DEC& other)
       p_out = p_next;
     }
 
-  PB_DS_ASSERT_VALID(other,true)
+  PB_DS_ASSERT_VALID_COND(other,true)
 
   node_pointer p_cur = base_type::m_p_root;
 
@@ -114,8 +114,8 @@ split(Pred pred, PB_DS_CLASS_C_DEC& other)
 
   m_p_max = 0;
 
-  PB_DS_ASSERT_VALID((*this),true)
-  PB_DS_ASSERT_VALID(other,true)
+  PB_DS_ASSERT_VALID_COND((*this),true)
+  PB_DS_ASSERT_VALID_COND(other,true)
 }
 
 PB_DS_CLASS_T_DEC
@@ -123,8 +123,8 @@ inline void
 PB_DS_CLASS_C_DEC::
 join(PB_DS_CLASS_C_DEC& other)
 {
-  PB_DS_ASSERT_VALID((*this),true)
-  PB_DS_ASSERT_VALID(other,true)
+  PB_DS_ASSERT_VALID_COND((*this),true)
+  PB_DS_ASSERT_VALID_COND(other,true)
 
   node_pointer p_other = other.m_p_root;
 
@@ -147,8 +147,8 @@ join(PB_DS_CLASS_C_DEC& other)
   other.m_size = 0;
   other.m_p_max = 0;
 
-  PB_DS_ASSERT_VALID((*this),true)
-  PB_DS_ASSERT_VALID(other,true)
+  PB_DS_ASSERT_VALID_COND((*this),true)
+  PB_DS_ASSERT_VALID_COND(other,true)
 }
 
 PB_DS_CLASS_T_DEC
index 47abe51350823af12987a73231cdb2b9f5df907f..149a206a4e73e713bab2c381cf3b4460d30f2d32 100644 (file)
@@ -101,14 +101,6 @@ namespace __gnu_pbds
 #define PB_DS_V2S(X) Mapped_Data()
 #endif
 
-#define PB_DS_CHECK_KEY_EXISTS(_Key)                                   \
-  _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(_Key, __FILE__, __LINE__);)
-
-#define PB_DS_CHECK_KEY_DOES_NOT_EXIST(_Key)                           \
-  _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(_Key,       \
-                                                          __FILE__, __LINE__);)
-
-
     // <011i$i0|\|-<|-|4i|\|i|\|g |-|4$|-| 74813.
     template<typename Key,
             typename Mapped,
@@ -621,15 +613,6 @@ namespace __gnu_pbds
       PB_DS_STATIC_ASSERT(sth, store_hash_ok);
     };
 
-#define PB_DS_ASSERT_VALID(X)                                          \
-  _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);)
-
-#define PB_DS_DEBUG_VERIFY(_Cond)                                      \
-  _GLIBCXX_DEBUG_VERIFY_AT(_Cond,                                      \
-                          _M_message(#_Cond" assertion from %1;:%2;")  \
-                          ._M_string(__FILE__)._M_integer(__LINE__)    \
-                          ,__file,__line)
-
 #include <ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_fn_imps.hpp>
 #include <ext/pb_ds/detail/cc_hash_table_map_/entry_list_fn_imps.hpp>
 #include <ext/pb_ds/detail/cc_hash_table_map_/find_fn_imps.hpp>
@@ -642,10 +625,6 @@ namespace __gnu_pbds
 #include <ext/pb_ds/detail/cc_hash_table_map_/insert_fn_imps.hpp>
 #include <ext/pb_ds/detail/cc_hash_table_map_/trace_fn_imps.hpp>
 
-#undef PB_DS_DEBUG_VERIFY
-#undef PB_DS_ASSERT_VALID
-#undef PB_DS_CHECK_KEY_DOES_NOT_EXIST
-#undef PB_DS_CHECK_KEY_EXISTS
 #undef PB_DS_CLASS_T_DEC
 #undef PB_DS_CLASS_C_DEC
 #undef PB_DS_HASH_EQ_FN_C_DEC
index 7f8d87a3c259afcdc864fcbc051cdb828f9fa5cb..2964b2d30c6dd03509963df1859c3b4601ff1fe0 100644 (file)
 
 #include <ext/typelist.h>
 
+#define PB_DS_ASSERT_VALID(X)                                          \
+  _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);)
+
+#define PB_DS_DEBUG_VERIFY(_Cond)                                      \
+  _GLIBCXX_DEBUG_VERIFY_AT(_Cond,                                      \
+                          _M_message(#_Cond" assertion from %1;:%2;")  \
+                          ._M_string(__FILE__)._M_integer(__LINE__)    \
+                          ,__file,__line)
+
+#define PB_DS_CHECK_KEY_EXISTS(_Key)                                   \
+  _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(_Key, __FILE__, __LINE__);)
+
+#define PB_DS_CHECK_KEY_DOES_NOT_EXIST(_Key)                           \
+  _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(_Key,       \
+                                                          __FILE__, __LINE__);)
+
 #define PB_DS_DATA_TRUE_INDICATOR
 #include <ext/pb_ds/detail/list_update_map_/lu_map_.hpp>
 #undef PB_DS_DATA_TRUE_INDICATOR
 #include <ext/pb_ds/detail/pat_trie_/pat_trie_.hpp>
 #undef PB_DS_DATA_FALSE_INDICATOR
 
+#undef PB_DS_CHECK_KEY_DOES_NOT_EXIST
+#undef PB_DS_CHECK_KEY_EXISTS
+#undef PB_DS_DEBUG_VERIFY
+#undef PB_DS_ASSERT_VALID
+
 namespace __gnu_pbds
 {
 namespace detail
index 1ade7957b66cc03f879ad3ff65d470f596dd67c0..a9a0b42d263d61f1756ec4217f2039ec8da8acda 100644 (file)
 #include <ext/throw_allocator.h>
 #include <debug/debug.h>
 
-#define PB_DS_ASSERT_VALID(X) \
-  _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);)
-
-#define PB_DS_DEBUG_VERIFY(_Cond)                                      \
-  _GLIBCXX_DEBUG_VERIFY_AT(_Cond,                                      \
-                          _M_message(#_Cond" assertion from %1;:%2;")  \
-                          ._M_string(__FILE__)._M_integer(__LINE__)    \
-                          ,__file,__line)
-
 namespace __gnu_pbds
 {
   namespace detail
@@ -356,8 +347,6 @@ namespace __gnu_pbds
 } // namespace detail
 } // namespace __gnu_pbds
 
-#undef PB_DS_DEBUG_VERIFY
-#undef PB_DS_ASSERT_VALID
 
 #endif
 
index ef3be7bd05491658a2d1fe3fd0d9a0a80f9452df..a9179d5363d4e73731d50c1c7cca6cd72d40ca89 100644 (file)
@@ -98,13 +98,6 @@ namespace __gnu_pbds
 #define PB_DS_V2S(X) Mapped()
 #endif
 
-#define PB_DS_CHECK_KEY_EXISTS(_Key)                                   \
-  _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(_Key, __FILE__, __LINE__);)
-
-#define PB_DS_CHECK_KEY_DOES_NOT_EXIST(_Key)                           \
-  _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(_Key,       \
-                                                          __FILE__, __LINE__);)
-
     template<typename Key,
             typename Mapped,
             typename Hash_Fn,
@@ -658,15 +651,6 @@ namespace __gnu_pbds
       PB_DS_STATIC_ASSERT(sth, store_hash_ok);
     };
 
-#define PB_DS_ASSERT_VALID(X)                                          \
-  _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);)
-
-#define PB_DS_DEBUG_VERIFY(_Cond)                                      \
-  _GLIBCXX_DEBUG_VERIFY_AT(_Cond,                                      \
-                          _M_message(#_Cond" assertion from %1;:%2;")  \
-                          ._M_string(__FILE__)._M_integer(__LINE__)    \
-                          ,__file,__line)
-
 #include <ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_fn_imps.hpp>
 #include <ext/pb_ds/detail/gp_hash_table_map_/find_fn_imps.hpp>
 #include <ext/pb_ds/detail/gp_hash_table_map_/resize_fn_imps.hpp>
@@ -678,10 +662,6 @@ namespace __gnu_pbds
 #include <ext/pb_ds/detail/gp_hash_table_map_/insert_fn_imps.hpp>
 #include <ext/pb_ds/detail/gp_hash_table_map_/trace_fn_imps.hpp>
 
-#undef PB_DS_DEBUG_VERIFY
-#undef PB_DS_ASSERT_VALID
-#undef PB_DS_CHECK_KEY_DOES_NOT_EXIST
-#undef PB_DS_CHECK_KEY_EXISTS
 #undef PB_DS_CLASS_T_DEC
 #undef PB_DS_CLASS_C_DEC
 #undef PB_DS_HASH_EQ_FN_C_DEC
index b433f359209a0ca857fbf781109a5dde7172c459..d31154638103a1afc14b4a8bdb785d4791f64f53 100644 (file)
@@ -332,15 +332,6 @@ namespace __gnu_pbds
       static no_throw_copies_t s_no_throw_copies_ind;
     };
 
-#define PB_DS_ASSERT_VALID(X) \
-  _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);)
-
-#define PB_DS_DEBUG_VERIFY(_Cond)                                      \
-  _GLIBCXX_DEBUG_VERIFY_AT(_Cond,                                      \
-                          _M_message(#_Cond" assertion from %1;:%2;")  \
-                          ._M_string(__FILE__)._M_integer(__LINE__)    \
-                          ,__file,__line)
-
 #include <ext/pb_ds/detail/left_child_next_sibling_heap_/constructors_destructor_fn_imps.hpp>
 #include <ext/pb_ds/detail/left_child_next_sibling_heap_/iterators_fn_imps.hpp>
 #include <ext/pb_ds/detail/left_child_next_sibling_heap_/debug_fn_imps.hpp>
@@ -350,8 +341,6 @@ namespace __gnu_pbds
 #include <ext/pb_ds/detail/left_child_next_sibling_heap_/info_fn_imps.hpp>
 #include <ext/pb_ds/detail/left_child_next_sibling_heap_/policy_access_fn_imps.hpp>
 
-#undef PB_DS_DEBUG_VERIFY
-#undef PB_DS_ASSERT_VALID
 #undef PB_DS_CLASS_C_DEC
 #undef PB_DS_CLASS_T_DEC
 
index 2e2f6a20d51cb0eabbec2801536726aa27d4fa36..329f2fa780ae60ceb8eec6df20c85587a94e4fa3 100644 (file)
@@ -337,22 +337,6 @@ namespace __gnu_pbds
       mutable entry_pointer m_p_l;
     };
 
-#define PB_DS_ASSERT_VALID(X)                                          \
-  _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);)
-
-#define PB_DS_CHECK_KEY_EXISTS(_Key)                                   \
-  _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(_Key, __FILE__, __LINE__);)
-
-#define PB_DS_CHECK_KEY_DOES_NOT_EXIST(_Key)                           \
-  _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(_Key,       \
-                                                          __FILE__, __LINE__);)
-
-#define PB_DS_DEBUG_VERIFY(_Cond)                                      \
-  _GLIBCXX_DEBUG_VERIFY_AT(_Cond,                                      \
-                          _M_message(#_Cond" assertion from %1;:%2;")  \
-                          ._M_string(__FILE__)._M_integer(__LINE__)    \
-                          ,__file,__line)
-
 #include <ext/pb_ds/detail/list_update_map_/constructor_destructor_fn_imps.hpp>
 #include <ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp>
 #include <ext/pb_ds/detail/list_update_map_/debug_fn_imps.hpp>
@@ -362,10 +346,6 @@ namespace __gnu_pbds
 #include <ext/pb_ds/detail/list_update_map_/insert_fn_imps.hpp>
 #include <ext/pb_ds/detail/list_update_map_/trace_fn_imps.hpp>
 
-#undef PB_DS_DEBUG_VERIFY
-#undef PB_DS_CHECK_KEY_DOES_NOT_EXIST
-#undef PB_DS_CHECK_KEY_EXISTS
-#undef PB_DS_ASSERT_VALID
 #undef PB_DS_CLASS_T_DEC
 #undef PB_DS_CLASS_C_DEC
 #undef  PB_DS_TYPES_TRAITS_C_DEC
index d6ba00b88565eb75c201a85e34dea89fe3b90c34..06436591ef5d642eec0bbbb5c49317d7e50c2e75 100644 (file)
@@ -107,15 +107,9 @@ namespace __gnu_pbds
                    Cmp_Fn, false, Allocator>
 #endif
 
-#define PB_DS_ASSERT_VALID(X)                                          \
-  _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);)
-
-#define PB_DS_CHECK_KEY_EXISTS(_Key)                                   \
-  _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(_Key, __FILE__, __LINE__);)
-
-#define PB_DS_CHECK_KEY_DOES_NOT_EXIST(_Key)                           \
-  _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(_Key,       \
-                                                          __FILE__, __LINE__);)
+#ifndef PB_DS_CHECK_KEY_EXISTS
+#  error Missing definition
+#endif
 
     // Ordered-vector tree associative-container.
     template<typename Key, typename Mapped, class Cmp_Fn,
@@ -502,12 +496,6 @@ namespace __gnu_pbds
       size_type m_size;
     };
 
-#define PB_DS_DEBUG_VERIFY(_Cond)                                      \
-  _GLIBCXX_DEBUG_VERIFY_AT(_Cond,                                      \
-                          _M_message(#_Cond" assertion from %1;:%2;")  \
-                          ._M_string(__FILE__)._M_integer(__LINE__)    \
-                          ,__file,__line)
-
 #include <ext/pb_ds/detail/ov_tree_map_/constructors_destructor_fn_imps.hpp>
 #include <ext/pb_ds/detail/ov_tree_map_/iterators_fn_imps.hpp>
 #include <ext/pb_ds/detail/ov_tree_map_/debug_fn_imps.hpp>
@@ -517,10 +505,6 @@ namespace __gnu_pbds
 #include <ext/pb_ds/detail/ov_tree_map_/split_join_fn_imps.hpp>
 #include <ext/pb_ds/detail/bin_search_tree_/policy_access_fn_imps.hpp>
 
-#undef PB_DS_DEBUG_VERIFY
-#undef PB_DS_CHECK_KEY_DOES_NOT_EXIST
-#undef PB_DS_CHECK_KEY_EXISTS
-#undef PB_DS_ASSERT_VALID
 #undef PB_DS_CLASS_C_DEC
 #undef PB_DS_CLASS_T_DEC
 #undef PB_DS_OV_TREE_CLASS_NAME
index 6677cc0fb24d5232b411357507d64d67baac8943..3bdb82fb649d699d5387f6863b0ed450dfe34019 100644 (file)
@@ -198,19 +198,10 @@ namespace __gnu_pbds
       remove_node(node_pointer p_nd);
     };
 
-#define PB_DS_ASSERT_VALID(X)                                          \
-  _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);)
-
 #define PB_DS_ASSERT_NODE_CONSISTENT(_Node, _Bool)                     \
   _GLIBCXX_DEBUG_ONLY(assert_node_consistent(_Node, _Bool,             \
                                             __FILE__, __LINE__);)
 
-#define PB_DS_DEBUG_VERIFY(_Cond)                                      \
-  _GLIBCXX_DEBUG_VERIFY_AT(_Cond,                                      \
-                          _M_message(#_Cond" assertion from %1;:%2;")  \
-                          ._M_string(__FILE__)._M_integer(__LINE__)    \
-                          ,__file,__line)
-
 #include <ext/pb_ds/detail/pairing_heap_/constructors_destructor_fn_imps.hpp>
 #include <ext/pb_ds/detail/pairing_heap_/debug_fn_imps.hpp>
 #include <ext/pb_ds/detail/pairing_heap_/find_fn_imps.hpp>
@@ -218,9 +209,7 @@ namespace __gnu_pbds
 #include <ext/pb_ds/detail/pairing_heap_/erase_fn_imps.hpp>
 #include <ext/pb_ds/detail/pairing_heap_/split_join_fn_imps.hpp>
 
-#undef PB_DS_DEBUG_VERIFY
 #undef PB_DS_ASSERT_NODE_CONSISTENT
-#undef PB_DS_ASSERT_VALID
 #undef PB_DS_CLASS_C_DEC
 #undef PB_DS_CLASS_T_DEC
 #undef PB_DS_BASE_C_DEC
index 9e30e65cd12505a8e98e49c46ae8237e0cc31ef3..cb8b6740d79d9963b40e3b1f499072c6c9f05d74 100644 (file)
@@ -566,12 +566,6 @@ namespace __gnu_pbds
     }
 
 #ifdef _GLIBCXX_DEBUG
-# define PB_DS_DEBUG_VERIFY(_Cond)                                     \
-  _GLIBCXX_DEBUG_VERIFY_AT(_Cond,                                      \
-                          _M_message(#_Cond" assertion from %1;:%2;")  \
-                          ._M_string(__FILE__)._M_integer(__LINE__)    \
-                          ,__file,__line)
-
     PB_DS_CLASS_T_DEC
     typename PB_DS_CLASS_C_DEC::subtree_debug_info
     PB_DS_CLASS_C_DEC::
@@ -596,7 +590,6 @@ namespace __gnu_pbds
        }
       return std::make_pair(pref_b_it(), pref_e_it());
     }
-# undef PB_DS_DEBUG_VERIFY
 #endif 
 
 #undef PB_DS_CLASS_T_DEC
index ba320434ca30fa9629aa58620270f714b52bae07..de8057a02197da50d8e0cc5ae70432810a2aa716 100644 (file)
@@ -140,12 +140,6 @@ namespace __gnu_pbds
     { return m_value; }
 
 #ifdef _GLIBCXX_DEBUG
-# define PB_DS_DEBUG_VERIFY(_Cond)                                     \
-  _GLIBCXX_DEBUG_VERIFY_AT(_Cond,                                      \
-                          _M_message(#_Cond" assertion from %1;:%2;")  \
-                          ._M_string(__FILE__)._M_integer(__LINE__)    \
-                          ,__file,__line)
-
     PB_DS_CLASS_T_DEC
     typename PB_DS_CLASS_C_DEC::subtree_debug_info
     PB_DS_CLASS_C_DEC::
@@ -162,7 +156,6 @@ namespace __gnu_pbds
     PB_DS_CLASS_T_DEC
     PB_DS_CLASS_C_DEC::
     ~pat_trie_leaf() { }
-# undef PB_DS_DEBUG_VERIFY
 #endif 
 
 #undef PB_DS_CLASS_T_DEC
index 738420f13f93abcb867f4a961ee4343e830533cd..5313c0b97120f5a632f268394ff7b6b1af4299e9 100644 (file)
@@ -495,28 +495,12 @@ namespace __gnu_pbds
       size_type m_size;
     };
 
-#define PB_DS_ASSERT_VALID(X)                                          \
-  _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);)
-
 #define PB_DS_ASSERT_NODE_VALID(X)                                     \
   _GLIBCXX_DEBUG_ONLY(X->assert_valid(this, __FILE__, __LINE__);)
 
 #define PB_DS_RECURSIVE_COUNT_LEAFS(X)                                 \
   recursive_count_leafs(X, __FILE__, __LINE__)
 
-#define PB_DS_CHECK_KEY_EXISTS(_Key)                                   \
-  _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(_Key, __FILE__, __LINE__);)
-
-#define PB_DS_CHECK_KEY_DOES_NOT_EXIST(_Key)                           \
-  _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(_Key,       \
-                                                          __FILE__, __LINE__);)
-
-#define PB_DS_DEBUG_VERIFY(_Cond)                                      \
-  _GLIBCXX_DEBUG_VERIFY_AT(_Cond,                                      \
-                          _M_message(#_Cond" assertion from %1;:%2;")  \
-                          ._M_string(__FILE__)._M_integer(__LINE__)    \
-                          ,__file,__line)
-
 #include <ext/pb_ds/detail/pat_trie_/constructors_destructor_fn_imps.hpp>
 #include <ext/pb_ds/detail/pat_trie_/iterators_fn_imps.hpp>
 #include <ext/pb_ds/detail/pat_trie_/insert_join_fn_imps.hpp>
@@ -529,12 +513,8 @@ namespace __gnu_pbds
 #include <ext/pb_ds/detail/pat_trie_/trace_fn_imps.hpp>
 #include <ext/pb_ds/detail/pat_trie_/update_fn_imps.hpp>
 
-#undef PB_DS_DEBUG_VERIFY
-#undef PB_DS_CHECK_KEY_DOES_NOT_EXIST
-#undef PB_DS_CHECK_KEY_EXISTS
 #undef PB_DS_RECURSIVE_COUNT_LEAFS
 #undef PB_DS_ASSERT_NODE_VALID
-#undef PB_DS_ASSERT_VALID
 #undef PB_DS_CLASS_C_DEC
 #undef PB_DS_CLASS_T_DEC
 #undef PB_DS_CLASS_NAME
index ad05c4f57113df1304f8f013d3bbf23bb8215307..c48ba7c6e1a1e9dc562ed369ae2c63c0e88c0d06 100644 (file)
 #ifndef PB_DS_PRIORITY_QUEUE_BASE_DS_DISPATCHER_HPP
 #define PB_DS_PRIORITY_QUEUE_BASE_DS_DISPATCHER_HPP
 
+#define PB_DS_ASSERT_VALID(X)                                          \
+  _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);)
+
+#define PB_DS_DEBUG_VERIFY(_Cond)                                      \
+  _GLIBCXX_DEBUG_VERIFY_AT(_Cond,                                      \
+                          _M_message(#_Cond" assertion from %1;:%2;")  \
+                          ._M_string(__FILE__)._M_integer(__LINE__)    \
+                          ,__file,__line)
+
 #include <ext/pb_ds/detail/pairing_heap_/pairing_heap_.hpp>
 #include <ext/pb_ds/detail/binomial_heap_/binomial_heap_.hpp>
 #include <ext/pb_ds/detail/rc_binomial_heap_/rc_binomial_heap_.hpp>
 #include <ext/pb_ds/detail/binary_heap_/binary_heap_.hpp>
 #include <ext/pb_ds/detail/thin_heap_/thin_heap_.hpp>
 
+#undef PB_DS_DEBUG_VERIFY
+#undef PB_DS_ASSERT_VALID
+
 namespace __gnu_pbds
 {
     namespace detail
index 92ea7d65a758b8094d629b21b24b04816b9a85c6..7d46c95d7e0a01fab59368571646ee6d4ddd58c5 100644 (file)
@@ -260,18 +260,9 @@ namespace __gnu_pbds
       split_at_node(node_pointer, PB_DS_CLASS_C_DEC&);
     };
 
-#define PB_DS_ASSERT_VALID(X)                                          \
-  _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);)
-
 #define PB_DS_STRUCT_ONLY_ASSERT_VALID(X)                              \
   _GLIBCXX_DEBUG_ONLY(X.structure_only_assert_valid(__FILE__, __LINE__);)
 
-#define PB_DS_DEBUG_VERIFY(_Cond)                                      \
-  _GLIBCXX_DEBUG_VERIFY_AT(_Cond,                                      \
-                          _M_message(#_Cond" assertion from %1;:%2;")  \
-                          ._M_string(__FILE__)._M_integer(__LINE__)    \
-                          ,__file,__line)
-
 #include <ext/pb_ds/detail/rb_tree_map_/constructors_destructor_fn_imps.hpp>
 #include <ext/pb_ds/detail/rb_tree_map_/insert_fn_imps.hpp>
 #include <ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp>
@@ -279,9 +270,7 @@ namespace __gnu_pbds
 #include <ext/pb_ds/detail/rb_tree_map_/split_join_fn_imps.hpp>
 #include <ext/pb_ds/detail/rb_tree_map_/info_fn_imps.hpp>
 
-#undef PB_DS_DEBUG_VERIFY
 #undef PB_DS_STRUCT_ONLY_ASSERT_VALID
-#undef PB_DS_ASSERT_VALID
 #undef PB_DS_CLASS_T_DEC
 #undef PB_DS_CLASS_C_DEC
 #undef PB_DS_CLASS_NAME
index d1942b99b17f98c5a290b396db13ef11c1eb1c12..845e6726db6d418abb4b90cb818110502eb9ac68 100644 (file)
 #ifndef PB_DS_RC_HPP
 #define PB_DS_RC_HPP
 
-#define PB_DS_ASSERT_VALID(X)                                          \
-  _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);)
-
-#define PB_DS_DEBUG_VERIFY(_Cond)                                      \
-  _GLIBCXX_DEBUG_VERIFY_AT(_Cond,                                      \
-                          _M_message(#_Cond" assertion from %1;:%2;")  \
-                          ._M_string(__FILE__)._M_integer(__LINE__)    \
-                          ,__file,__line)
-
 namespace __gnu_pbds
 {
   namespace detail
@@ -268,6 +259,4 @@ namespace __gnu_pbds
 } // namespace detail
 } // namespace __gnu_pbds
 
-#undef PB_DS_DEBUG_VERIFY
-#undef PB_DS_ASSERT_VALID
 #endif 
index 0bf8e4fd2794e7f6c67485dde9cadf86276615b7..767bf108861cc2024f3abbbc37c5096dd698174b 100644 (file)
@@ -180,15 +180,6 @@ namespace __gnu_pbds
       rc_t m_rc;
     };
 
-#define PB_DS_ASSERT_VALID(X)                                          \
-  _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);)
-
-#define PB_DS_DEBUG_VERIFY(_Cond)                                      \
-  _GLIBCXX_DEBUG_VERIFY_AT(_Cond,                                      \
-                          _M_message(#_Cond" assertion from %1;:%2;")  \
-                          ._M_string(__FILE__)._M_integer(__LINE__)    \
-                          ,__file,__line)
-
 #include <ext/pb_ds/detail/rc_binomial_heap_/constructors_destructor_fn_imps.hpp>
 #include <ext/pb_ds/detail/rc_binomial_heap_/debug_fn_imps.hpp>
 #include <ext/pb_ds/detail/rc_binomial_heap_/erase_fn_imps.hpp>
@@ -196,8 +187,6 @@ namespace __gnu_pbds
 #include <ext/pb_ds/detail/rc_binomial_heap_/insert_fn_imps.hpp>
 #include <ext/pb_ds/detail/rc_binomial_heap_/split_join_fn_imps.hpp>
 
-#undef PB_DS_DEBUG_VERIFY
-#undef PB_DS_ASSERT_VALID
 #undef PB_DS_CLASS_C_DEC
 #undef PB_DS_CLASS_T_DEC
 #undef PB_DS_BASE_C_DEC
index 3d1b3996991b7212ee2b42c4fb1e2d72fbb7c91d..c8a8816d5be9a59fea69bb9e2ad9c6366b7620cb 100644 (file)
@@ -286,8 +286,8 @@ void
 PB_DS_CLASS_C_DEC::
 assert_valid(const char* __file, int __line) const
 {
-  _GLIBCXX_DEBUG_ASSERT(m_load_max > m_load_min);
-  _GLIBCXX_DEBUG_ASSERT(m_next_grow_size >= m_next_shrink_size);
+  PB_DS_DEBUG_VERIFY(m_load_max > m_load_min);
+  PB_DS_DEBUG_VERIFY(m_next_grow_size >= m_next_shrink_size);
 }
 # undef PB_DS_DEBUG_VERIFY
 #endif
index 7c91b77f792e19908a504a831777e38b84834e4c..b6afa758eb810a75795d3dad01bb5417614f9184 100644 (file)
@@ -136,6 +136,9 @@ namespace __gnu_pbds
     {
     private:
       typedef PB_DS_BASE_C_DEC base_type;
+#ifdef _GLIBCXX_DEBUG
+      typedef base_type debug_base;
+#endif
       typedef typename base_type::node_pointer node_pointer;
 
     public:
@@ -277,23 +280,10 @@ namespace __gnu_pbds
       erase_node(node_pointer);
     };
 
-#define PB_DS_ASSERT_VALID(X)                                          \
-  _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);)
-
 #define PB_DS_ASSERT_BASE_NODE_CONSISTENT(_Node)                       \
   _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(_Node,         \
                                                        __FILE__, __LINE__);)
 
-#define PB_DS_CHECK_KEY_DOES_NOT_EXIST(_Key)                           \
-  _GLIBCXX_DEBUG_ONLY(base_type::check_key_does_not_exist(_Key,        \
-                                                          __FILE__, __LINE__);)
-
-#define PB_DS_DEBUG_VERIFY(_Cond)                                      \
-  _GLIBCXX_DEBUG_VERIFY_AT(_Cond,                                      \
-                          _M_message(#_Cond" assertion from %1;:%2;")  \
-                          ._M_string(__FILE__)._M_integer(__LINE__)    \
-                          ,__file,__line)
-
 #include <ext/pb_ds/detail/splay_tree_/constructors_destructor_fn_imps.hpp>
 #include <ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp>
 #include <ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp>
@@ -302,10 +292,7 @@ namespace __gnu_pbds
 #include <ext/pb_ds/detail/splay_tree_/debug_fn_imps.hpp>
 #include <ext/pb_ds/detail/splay_tree_/split_join_fn_imps.hpp>
 
-#undef PB_DS_DEBUG_VERIFY
-#undef PB_DS_CHECK_KEY_DOES_NOT_EXIST
 #undef PB_DS_ASSERT_BASE_NODE_CONSISTENT
-#undef PB_DS_ASSERT_VALID
 #undef PB_DS_CLASS_T_DEC
 #undef PB_DS_CLASS_C_DEC
 #undef PB_DS_CLASS_NAME
index d5fba5f5ac61b1d6442e0cb758851d02ddeb478c..9741ef9cf1cda35bb7f5ddadd5da7a7123cc7549 100644 (file)
@@ -334,9 +334,6 @@ namespace __gnu_pbds
        /* Pot's good, let's play */
       };
 
-#define PB_DS_ASSERT_VALID(X)                                          \
-  _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);)
-
 #define PB_DS_ASSERT_NODE_CONSISTENT(_Node, _Bool)                     \
   _GLIBCXX_DEBUG_ONLY(assert_node_consistent(_Node, _Bool,             \
                                             __FILE__, __LINE__);)
@@ -344,12 +341,6 @@ namespace __gnu_pbds
 #define PB_DS_ASSERT_AUX_NULL(X)                                               \
   _GLIBCXX_DEBUG_ONLY(X.assert_aux_null(__FILE__, __LINE__);)
 
-#define PB_DS_DEBUG_VERIFY(_Cond)                                      \
-  _GLIBCXX_DEBUG_VERIFY_AT(_Cond,                                      \
-                          _M_message(#_Cond" assertion from %1;:%2;")  \
-                          ._M_string(__FILE__)._M_integer(__LINE__)    \
-                          ,__file,__line)
-
 #include <ext/pb_ds/detail/thin_heap_/constructors_destructor_fn_imps.hpp>
 #include <ext/pb_ds/detail/thin_heap_/debug_fn_imps.hpp>
 #include <ext/pb_ds/detail/thin_heap_/trace_fn_imps.hpp>
@@ -358,10 +349,8 @@ namespace __gnu_pbds
 #include <ext/pb_ds/detail/thin_heap_/erase_fn_imps.hpp>
 #include <ext/pb_ds/detail/thin_heap_/split_join_fn_imps.hpp>
 
-#undef PB_DS_DEBUG_VERIFY
 #undef PB_DS_ASSERT_AUX_NULL
 #undef PB_DS_ASSERT_NODE_CONSISTENT
-#undef PB_DS_ASSERT_VALID
 #undef PB_DS_CLASS_C_DEC
 #undef PB_DS_CLASS_T_DEC
 #undef PB_DS_BASE_C_DEC