]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/include/ext/pb_ds/detail/binomial_heap_base_/find_fn_imps.hpp
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / include / ext / pb_ds / detail / binomial_heap_base_ / find_fn_imps.hpp
index ad7f65129ba36a73cca01e6895bda9f31012f2e9..ea05c3caaa081d352625a816733e95e7e1fa1727 100644 (file)
@@ -1,6 +1,6 @@
 // -*- C++ -*-
 
-// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2005-2020 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the terms
 // warranty.
 
 /**
- * @file find_fn_imps.hpp
+ * @file binomial_heap_base_/find_fn_imps.hpp
  * Contains an implementation class for a base of binomial heaps.
  */
 
+#ifdef PB_DS_CLASS_C_DEC
+
 PB_DS_CLASS_T_DEC
 inline typename PB_DS_CLASS_C_DEC::const_reference
 PB_DS_CLASS_C_DEC::
 top() const
 {
-  _GLIBCXX_DEBUG_ONLY(assert_valid(false);)
-    _GLIBCXX_DEBUG_ASSERT(!base_type::empty());
+  PB_DS_ASSERT_VALID_COND((*this),false)
+  _GLIBCXX_DEBUG_ASSERT(!base_type::empty());
 
-  if (m_p_max == NULL)
+  if (m_p_max == 0)
     const_cast<PB_DS_CLASS_C_DEC* >(this)->find_max();
 
-  _GLIBCXX_DEBUG_ASSERT(m_p_max != NULL);
+  _GLIBCXX_DEBUG_ASSERT(m_p_max != 0);
   return m_p_max->m_value;
 }
 
@@ -59,15 +61,13 @@ PB_DS_CLASS_C_DEC::
 find_max()
 {
   node_pointer p_cur = base_type::m_p_root;
-
   m_p_max = p_cur;
-
-  while (p_cur != NULL)
+  while (p_cur != 0)
     {
       if (Cmp_Fn::operator()(m_p_max->m_value, p_cur->m_value))
        m_p_max = p_cur;
-
       p_cur = p_cur->m_p_next_sibling;
     }
 }
 
+#endif