STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
point_const_iterator.hpp
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 // Copyright (C) 2005-2013 Free Software Foundation, Inc.
4 //
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the terms
7 // of the GNU General Public License as published by the Free Software
8 // Foundation; either version 3, or (at your option) any later
9 // version.
10 
11 // This library is distributed in the hope that it will be useful, but
12 // WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // General Public License for more details.
15 
16 // Under Section 7 of GPL version 3, you are granted additional
17 // permissions described in the GCC Runtime Library Exception, version
18 // 3.1, as published by the Free Software Foundation.
19 
20 // You should have received a copy of the GNU General Public License and
21 // a copy of the GCC Runtime Library Exception along with this program;
22 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23 // <http://www.gnu.org/licenses/>.
24 
25 // Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
26 
27 // Permission to use, copy, modify, sell, and distribute this software
28 // is hereby granted without fee, provided that the above copyright
29 // notice appears in all copies, and that both that copyright notice
30 // and this permission notice appear in supporting documentation. None
31 // of the above authors, nor IBM Haifa Research Laboratories, make any
32 // representation about the suitability of this software for any
33 // purpose. It is provided "as is" without express or implied
34 // warranty.
35 
42 #ifndef PB_DS_BINARY_HEAP_CONST_FIND_ITERATOR_HPP
43 #define PB_DS_BINARY_HEAP_CONST_FIND_ITERATOR_HPP
44 
46 #include <debug/debug.h>
47 
48 namespace __gnu_pbds
49 {
50  namespace detail
51  {
53  template<typename Value_Type, typename Entry, bool Simple,
54  typename _Alloc>
56  {
57  protected:
58  typedef typename _Alloc::template rebind<Entry>::other::pointer entry_pointer;
59 
60  public:
63 
66 
68  typedef Value_Type value_type;
69 
71  typedef typename _Alloc::template rebind<value_type>::other::pointer
73 
75  typedef
76  typename _Alloc::template rebind<value_type>::other::const_pointer
78 
80  typedef
81  typename _Alloc::template rebind<value_type>::other::reference
83 
85  typedef
86  typename _Alloc::template rebind<value_type>::other::const_reference
88 
89  inline
91  { }
92 
94  inline
96 
98  inline
100  : m_p_e(other.m_p_e)
101  { }
102 
104  inline const_pointer
105  operator->() const
106  {
108  return to_ptr(integral_constant<int, Simple>());
109  }
110 
112  inline const_reference
113  operator*() const
114  {
116  return *to_ptr(integral_constant<int, Simple>());
117  }
118 
120  inline bool
122  { return m_p_e == other.m_p_e; }
123 
125  inline bool
127  { return m_p_e != other.m_p_e; }
128 
129  private:
130  inline const_pointer
132  { return m_p_e; }
133 
134  inline const_pointer
136  { return *m_p_e; }
137 
138  public:
140  };
141  } // namespace detail
142 } // namespace __gnu_pbds
143 
144 #endif
entry_pointer m_p_e
Definition: point_const_iterator.hpp:139
const_pointer operator->() const
Access.
Definition: point_const_iterator.hpp:105
void trivial_iterator_difference_type
Prohibit moving trivial iterators.
Definition: tag_and_trait.hpp:79
bool operator!=(const binary_heap_point_const_iterator_ &other) const
Compares content (negatively) to a different iterator object.
Definition: point_const_iterator.hpp:126
_Alloc::template rebind< value_type >::other::reference reference
Iterator's reference type.
Definition: point_const_iterator.hpp:82
_Alloc::template rebind< value_type >::other::const_reference const_reference
Iterator's const reference type.
Definition: point_const_iterator.hpp:87
#define _GLIBCXX_DEBUG_ASSERT(_Condition)
Definition: debug.h:61
_Alloc::template rebind< value_type >::other::pointer pointer
Iterator's pointer type.
Definition: point_const_iterator.hpp:72
binary_heap_point_const_iterator_(const binary_heap_point_const_iterator_ &other)
Copy constructor.
Definition: point_const_iterator.hpp:99
trivial_iterator_tag iterator_category
Category.
Definition: point_const_iterator.hpp:62
binary_heap_point_const_iterator_()
Default constructor.
Definition: point_const_iterator.hpp:95
Value_Type value_type
Iterator's value type.
Definition: point_const_iterator.hpp:68
const_pointer to_ptr(true_type) const
Definition: point_const_iterator.hpp:131
const_pointer to_ptr(false_type) const
Definition: point_const_iterator.hpp:135
binary_heap_point_const_iterator_(entry_pointer p_e)
Definition: point_const_iterator.hpp:90
const_reference operator*() const
Access.
Definition: point_const_iterator.hpp:113
Definition: tag_and_trait.hpp:75
std::tr1::integral_constant< int, 1 > true_type
Definition: type_utils.hpp:70
Const point-type iterator.
Definition: point_const_iterator.hpp:55
bool operator==(const binary_heap_point_const_iterator_ &other) const
Compares content to a different iterator object.
Definition: point_const_iterator.hpp:121
trivial_iterator_difference_type difference_type
Difference type.
Definition: point_const_iterator.hpp:65
_Alloc::template rebind< Entry >::other::pointer entry_pointer
Definition: point_const_iterator.hpp:58
_Alloc::template rebind< value_type >::other::const_pointer const_pointer
Iterator's const pointer type.
Definition: point_const_iterator.hpp:77
std::tr1::integral_constant< int, 0 > false_type
Definition: type_utils.hpp:71