]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/node_iterators.hpp
Update copyright years in libstdc++-v3/
[thirdparty/gcc.git] / libstdc++-v3 / include / ext / pb_ds / detail / bin_search_tree_ / node_iterators.hpp
index d64bdf75d9c24a22165f20925b8098d8f092b5d1..77c826f223e7b34cdc1d8eb53161f2cacc1318ce 100644 (file)
@@ -1,6 +1,6 @@
 // -*- C++ -*-
 
-// Copyright (C) 2005, 2006, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2005-2014 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
@@ -47,12 +47,8 @@ namespace __gnu_pbds
 {
   namespace detail
   {
-#define PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC                     \
-    bin_search_tree_const_node_it_<                                    \
-                                                       Node,           \
-                                                       Const_Iterator, \
-                                                       Iterator,       \
-                                                       _Alloc>
+#define PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC \
+    bin_search_tree_const_node_it_<Node, Const_Iterator, Iterator, _Alloc>
 
     /// Const node iterator.
     template<typename Node,
@@ -68,99 +64,76 @@ namespace __gnu_pbds
       node_pointer;
 
     public:
-      // Category.
+      /// Category.
       typedef trivial_iterator_tag iterator_category;
 
-      // Difference type.
+      /// Difference type.
       typedef trivial_iterator_difference_type difference_type;
 
-      // __Iterator's value type.
+      //Iterator's value type.
       typedef Const_Iterator value_type;
 
-      // __Iterator's reference type.
+      //Iterator's reference type.
       typedef Const_Iterator reference;
 
-      // __Iterator's __const reference type.
+      //Iterator's __const reference type.
       typedef Const_Iterator const_reference;
 
-      // Metadata type.
+      /// Metadata type.
       typedef typename Node::metadata_type metadata_type;
 
-      // Const metadata reference type.
+      /// Const metadata reference type.
       typedef
-      typename _Alloc::template rebind<
-       metadata_type>::other::const_reference
+      typename _Alloc::template rebind<metadata_type>::other::const_reference
       metadata_const_reference;
 
-      // Default constructor.
-      /*
-       inline
-       bin_search_tree_const_node_it_()
-      */
 
-      inline
-      bin_search_tree_const_node_it_(const node_pointer p_nd = 0) 
+      bin_search_tree_const_node_it_(const node_pointer p_nd = 0)
       : m_p_nd(const_cast<node_pointer>(p_nd))
       { }
 
-      // Access.
-      inline const_reference
+      /// Access.
+      const_reference
       operator*() const
-      {
-       return (Const_Iterator(m_p_nd));
-      }
+      { return Const_Iterator(m_p_nd); }
 
-      // Metadata access.
-      inline metadata_const_reference
+      /// Metadata access.
+      metadata_const_reference
       get_metadata() const
-      {
-       return (m_p_nd->get_metadata());
-      }
+      { return m_p_nd->get_metadata(); }
 
-      // Returns the __const node iterator associated with the left node.
-      inline PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC
+      /// Returns the __const node iterator associated with the left node.
+      PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC
       get_l_child() const
-      {
-       return (PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC(m_p_nd->m_p_left));
-      }
+      { return PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC(m_p_nd->m_p_left); }
 
-      // Returns the __const node iterator associated with the right node.
-      inline PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC
+      /// Returns the __const node iterator associated with the right node.
+      PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC
       get_r_child() const
-      {
-       return (PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC(m_p_nd->m_p_right));
-      }
+      { return PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC(m_p_nd->m_p_right); }
 
-      // Compares to a different iterator object.
-      inline bool
+      /// Compares to a different iterator object.
+      bool
       operator==(const PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC& other) const
-      {
-       return (m_p_nd == other.m_p_nd);
-      }
+      { return m_p_nd == other.m_p_nd; }
 
-      // Compares (negatively) to a different iterator object.
-      inline bool
+      /// Compares (negatively) to a different iterator object.
+      bool
       operator!=(const PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC& other) const
-      {
-       return (m_p_nd != other.m_p_nd);
-      }
+      { return m_p_nd != other.m_p_nd; }
 
       node_pointer m_p_nd;
     };
 
-#define PB_DS_TREE_NODE_ITERATOR_CLASS_C_DEC                   \
-    bin_search_tree_node_it_<                                  \
-                                               Node,           \
-                                               Const_Iterator, \
-                                               Iterator,       \
-                                               _Alloc>
+#define PB_DS_TREE_NODE_ITERATOR_CLASS_C_DEC \
+    bin_search_tree_node_it_<Node, Const_Iterator, Iterator, _Alloc>
 
     /// Node iterator.
     template<typename Node,
             class Const_Iterator,
             class Iterator,
             typename _Alloc>
-    class bin_search_tree_node_it_ 
+    class bin_search_tree_node_it_
     : public PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC
     {
     private:
@@ -170,47 +143,39 @@ namespace __gnu_pbds
       node_pointer;
 
     public:
-      // __Iterator's value type.
+      //Iterator's value type.
       typedef Iterator value_type;
 
-      // __Iterator's reference type.
+      //Iterator's reference type.
       typedef Iterator reference;
 
-      // __Iterator's __const reference type.
+      //Iterator's __const reference type.
       typedef Iterator const_reference;
 
-      // Default constructor.
-      /*
-       inline
-       bin_search_tree_node_it_();
-      */
-
       inline
-      bin_search_tree_node_it_(const node_pointer p_nd = 0) 
+      bin_search_tree_node_it_(const node_pointer p_nd = 0)
       : PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC(const_cast<node_pointer>(p_nd))
       { }
 
-      // Access.
-      inline Iterator
+      /// Access.
+      Iterator
       operator*() const
-      {
-       return (Iterator(PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC::m_p_nd));
-      }
+      { return Iterator(PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC::m_p_nd); }
 
-      // Returns the node iterator associated with the left node.
-      inline PB_DS_TREE_NODE_ITERATOR_CLASS_C_DEC
+      /// Returns the node iterator associated with the left node.
+      PB_DS_TREE_NODE_ITERATOR_CLASS_C_DEC
       get_l_child() const
       {
-       return (PB_DS_TREE_NODE_ITERATOR_CLASS_C_DEC(
-                                                    PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC::m_p_nd->m_p_left));
+       return PB_DS_TREE_NODE_ITERATOR_CLASS_C_DEC(
+                                                   PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC::m_p_nd->m_p_left);
       }
 
-      // Returns the node iterator associated with the right node.
-      inline PB_DS_TREE_NODE_ITERATOR_CLASS_C_DEC
+      /// Returns the node iterator associated with the right node.
+      PB_DS_TREE_NODE_ITERATOR_CLASS_C_DEC
       get_r_child() const
       {
-       return (PB_DS_TREE_NODE_ITERATOR_CLASS_C_DEC(
-                                                    PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC::m_p_nd->m_p_right));
+       return PB_DS_TREE_NODE_ITERATOR_CLASS_C_DEC(
+                                                   PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC::m_p_nd->m_p_right);
       }
 
     };
@@ -222,4 +187,3 @@ namespace __gnu_pbds
 } // namespace __gnu_pbds
 
 #endif // #ifndef PB_DS_BIN_SEARCH_TREE_NODE_ITERATORS_HPP
-