3 // Copyright (C) 2005 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
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 2, or (at your option)
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with this library; see the file COPYING. If not, write to the Free
18 // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
21 // As a special exception, you may use this file as part of a free software
22 // library without restriction. Specifically, if other files instantiate
23 // templates or use macros or inline functions from this file, or you compile
24 // this file and link it with other files to produce an executable, this
25 // file does not by itself cause the resulting executable to be covered by
26 // the GNU General Public License. This exception does not however
27 // invalidate any other reasons why the executable file might be covered by
28 // the GNU General Public License.
30 // Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
32 // Permission to use, copy, modify, sell, and distribute this software
33 // is hereby granted without fee, provided that the above copyright
34 // notice appears in all copies, and that both that copyright notice and
35 // this permission notice appear in supporting documentation. None of
36 // the above authors, nor IBM Haifa Research Laboratories, make any
37 // representation about the suitability of this software for any
38 // purpose. It is provided "as is" without express or implied warranty.
41 * @file ds_trait_imp.hpp
42 * Contains data-structure traits implementation.
45 #ifndef DS_TRAIT_IMP_HPP
46 #define DS_TRAIT_IMP_HPP
51 template<class Cntnr
, class DS_Category
>
52 struct erase_can_throw_imp
57 pb_assoc::detail::is_same_type
<
59 ov_tree_ds_tag
>::value
64 struct erase_can_throw_imp
<
70 value
= Cntnr::erase_can_throw
74 template<class Cntnr
, class DS_Category
>
75 struct erase_iterators_imp
80 pb_assoc::detail::is_same_type
<
82 rb_tree_ds_tag
>::value
||
83 pb_assoc::detail::is_same_type
<
85 splay_tree_ds_tag
>::value
90 struct erase_iterators_imp
<
96 value
= Cntnr::erase_iterators
100 template<class Cntnr
, class DS_Category
>
101 struct order_preserving_imp
106 pb_assoc::detail::is_same_type
<
108 rb_tree_ds_tag
>::value
||
109 pb_assoc::detail::is_same_type
<
111 splay_tree_ds_tag
>::value
||
112 pb_assoc::detail::is_same_type
<
114 ov_tree_ds_tag
>::value
118 template<class Cntnr
>
119 struct order_preserving_imp
<
125 value
= Cntnr::order_preserving
129 template<class Cntnr
, class DS_Category
>
130 struct invalidation_guarantee_imp
136 pb_assoc::detail::is_same_type
<
138 cc_hash_ds_tag
>::value
||
139 pb_assoc::detail::is_same_type
<
141 rb_tree_ds_tag
>::value
||
142 pb_assoc::detail::is_same_type
<
144 splay_tree_ds_tag
>::value
||
145 pb_assoc::detail::is_same_type
<
153 pb_assoc::detail::is_same_type
<
155 cc_hash_ds_tag
>::value
164 find_invalidation_guarantee
,
165 range_invalidation_guarantee
>::type
,
166 basic_invalidation_guarantee
>::type
170 template<class Cntnr
>
171 struct invalidation_guarantee_imp
<
175 typedef typename
Cntnr::invalidation_guarantee type
;
178 template<class Cntnr
, class DS_Category
>
179 struct reverse_iteration_imp
186 rb_tree_ds_tag
>::value
||
189 splay_tree_ds_tag
>::value
193 template<class Cntnr
>
194 struct reverse_iteration_imp
<
200 value
= Cntnr::reverse_iteration
204 template<class Cntnr
, class DS_Category
>
205 struct split_join_imp
212 rb_tree_ds_tag
>::value
||
215 splay_tree_ds_tag
>::value
||
218 ov_tree_ds_tag
>::value
222 template<class Cntnr
>
223 struct split_join_imp
<
233 template<class Cntnr
>
234 struct basic_data_structure_traits
240 typedef typename
Cntnr::ds_category ds_category
;
246 pb_assoc::detail::erase_can_throw_imp
<
254 pb_assoc::detail::order_preserving_imp
<
262 pb_assoc::detail::erase_iterators_imp
<
268 typename
pb_assoc::detail::invalidation_guarantee_imp
<
271 invalidation_guarantee
;
276 pb_assoc::detail::reverse_iteration_imp
<
284 pb_assoc::detail::split_join_imp
<
290 template<class Cntnr
, class DS_Category
>
291 struct data_structure_traits
: public basic_data_structure_traits
<
295 template<class Cntnr
>
296 struct data_structure_traits
<
298 rb_tree_ds_tag
> : public basic_data_structure_traits
<
304 split_join_can_throw
= false
308 template<class Cntnr
>
309 struct data_structure_traits
<
311 splay_tree_ds_tag
> : public basic_data_structure_traits
<
317 split_join_can_throw
= false
321 template<class Cntnr
>
322 struct data_structure_traits
<
324 ov_tree_ds_tag
> : public basic_data_structure_traits
<
330 split_join_can_throw
= true
334 } // namespace detail
336 #endif // #ifndef DS_TRAIT_IMP_HPP