3 // Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
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
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.
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.
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/>.
25 // Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
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
37 * @file bin_search_tree_/traits.hpp
38 * Contains an implementation for bin_search_tree_.
41 #ifndef PB_DS_BIN_SEARCH_TREE_NODE_AND_IT_TRAITS_HPP
42 #define PB_DS_BIN_SEARCH_TREE_NODE_AND_IT_TRAITS_HPP
44 #include <ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp>
45 #include <ext/pb_ds/detail/bin_search_tree_/node_iterators.hpp>
51 /// Binary search tree traits, primary template.
52 template<typename Key,
55 template<typename Node_CItr,
62 struct bin_search_tree_traits
65 typedef types_traits<Key, Mapped, _Alloc, false> type_traits;
71 bin_search_tree_const_it_<
72 typename _Alloc::template rebind<
73 node>::other::pointer,
74 typename type_traits::value_type,
75 typename type_traits::pointer,
76 typename type_traits::const_pointer,
77 typename type_traits::reference,
78 typename type_traits::const_reference,
85 typename _Alloc::template rebind<
86 node>::other::pointer,
87 typename type_traits::value_type,
88 typename type_traits::pointer,
89 typename type_traits::const_pointer,
90 typename type_traits::reference,
91 typename type_traits::const_reference,
97 bin_search_tree_const_it_<
98 typename _Alloc::template rebind<
99 node>::other::pointer,
100 typename type_traits::value_type,
101 typename type_traits::pointer,
102 typename type_traits::const_pointer,
103 typename type_traits::reference,
104 typename type_traits::const_reference,
107 const_reverse_iterator;
111 typename _Alloc::template rebind<
112 node>::other::pointer,
113 typename type_traits::value_type,
114 typename type_traits::pointer,
115 typename type_traits::const_pointer,
116 typename type_traits::reference,
117 typename type_traits::const_reference,
123 bin_search_tree_const_node_it_<
125 point_const_iterator,
131 bin_search_tree_node_it_<
133 point_const_iterator,
147 __gnu_pbds::null_node_update<
152 null_node_update_pointer;
156 template<typename Key,
158 template<typename Node_CItr,
165 struct bin_search_tree_traits<
174 typedef types_traits<Key, null_type, _Alloc, false> type_traits;
180 bin_search_tree_const_it_<
181 typename _Alloc::template rebind<
182 node>::other::pointer,
183 typename type_traits::value_type,
184 typename type_traits::pointer,
185 typename type_traits::const_pointer,
186 typename type_traits::reference,
187 typename type_traits::const_reference,
190 point_const_iterator;
192 typedef point_const_iterator point_iterator;
195 bin_search_tree_const_it_<
196 typename _Alloc::template rebind<
197 node>::other::pointer,
198 typename type_traits::value_type,
199 typename type_traits::pointer,
200 typename type_traits::const_pointer,
201 typename type_traits::reference,
202 typename type_traits::const_reference,
205 const_reverse_iterator;
207 typedef const_reverse_iterator reverse_iterator;
210 bin_search_tree_const_node_it_<
212 point_const_iterator,
217 typedef node_const_iterator node_iterator;
220 Node_Update<node_const_iterator, node_iterator, Cmp_Fn, _Alloc>
224 __gnu_pbds::null_node_update<
229 null_node_update_pointer;
232 } // namespace detail
233 } // namespace __gnu_pbds
235 #endif // #ifndef PB_DS_BIN_SEARCH_TREE_NODE_AND_IT_TRAITS_HPP