3 // Copyright (C) 2005-2020 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 // You should have received a copy of the GNU General Public License
17 // along with this library; see the file COPYING3. If not see
18 // <http://www.gnu.org/licenses/>.
21 // Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
23 // Permission to use, copy, modify, sell, and distribute this software
24 // is hereby granted without fee, provided that the above copyright
25 // notice appears in all copies, and that both that copyright notice
26 // and this permission notice appear in supporting documentation. None
27 // of the above authors, nor IBM Haifa Research Laboratories, make any
28 // representation about the suitability of this software for any
29 // purpose. It is provided "as is" without express or implied
33 * @file multimap_common_type.hpp
34 * Contains types for a generic multimap_insert_test test.
37 #ifndef PB_DS_MULTIMAP_RANDOM_INT_INSERT_TEST_COMMON_TYPE_HPP
38 #define PB_DS_MULTIMAP_RANDOM_INT_INSERT_TEST_COMMON_TYPE_HPP
40 #include <hash_fn/string_hash_fn.hpp>
41 #include <common_type/assoc/common_type.hpp>
49 struct int_hash : public std::unary_function<int, size_t>
52 operator()(const int i) const
53 { return (static_cast<size_t>(i)); }
56 template<typename Key, typename _Alloc = std::allocator<char> >
60 typename __gnu_pbds::test::hash_common_types<
62 __gnu_pbds::null_type,
65 _Alloc>::performance_min_tl
69 template<typename Key, typename _Alloc = std::allocator<char> >
73 typename __gnu_pbds::test::lu_common_types<
75 __gnu_pbds::null_type,
78 _Alloc>::performance_min_tl
82 template<typename Key,
84 typename _Alloc = std::allocator<char> >
89 typename __gnu_pbds::detail::__conditional_type<
90 __gnu_pbds::detail::is_same<
94 string_hash_fn>::__type
97 template<typename Cntnr_T>
98 struct hash_mmap_transform
101 typename __gnu_pbds::test::hash_common_types<
107 _Alloc>::performance_min_tl
113 typename __gnu_cxx::typelist::flatten<
114 typename __gnu_cxx::typelist::transform<
116 hash_mmap_transform>::type>::type
120 template<typename Key,
122 typename _Alloc = std::allocator<char> >
123 struct tree_mmap_tl_t
126 template<typename Cntnr_T>
127 struct tree_mmap_transform
130 typename __gnu_pbds::test::tree_common_types<
135 __gnu_pbds::null_node_update,
136 _Alloc>::performance_min_tl
142 typename __gnu_cxx::typelist::flatten<
143 typename __gnu_cxx::typelist::transform<
145 tree_mmap_transform>::type>::type
149 template<typename Key, typename Mapped, typename _Alloc>
150 struct hash_hash_mmap_tl_t
153 typedef typename hash_set_tl_t<Mapped, _Alloc>::type sec_tl_t;
156 typedef typename hash_mmap_tl_t<Key, sec_tl_t, _Alloc>::type type;
159 template<typename Key, typename Mapped, typename _Alloc>
160 struct tree_hash_mmap_tl_t
163 typedef typename hash_set_tl_t<Mapped, _Alloc>::type sec_tl_t;
166 typedef typename tree_mmap_tl_t<Key, sec_tl_t, _Alloc>::type type;
169 template<typename Key, typename Mapped, typename _Alloc>
170 struct tree_lu_mmap_tl_t
173 typedef typename lu_set_tl_t<Mapped, _Alloc>::type sec_tl_t;
176 typedef typename tree_mmap_tl_t<Key, sec_tl_t, _Alloc>::type type;
179 template<typename Key, typename Mapped, typename _Alloc>
180 struct hash_lu_mmap_tl_t
183 typedef typename lu_set_tl_t<Mapped, _Alloc>::type sec_tl_t;
186 typedef typename hash_mmap_tl_t<Key, sec_tl_t, _Alloc>::type type;
188 } // namespace detail
190 template<typename Key, typename Mapped, typename _Alloc>
195 typename detail::hash_hash_mmap_tl_t<Key, Mapped, _Alloc>::type
199 typename detail::hash_lu_mmap_tl_t<Key, Mapped, _Alloc>::type
203 typename detail::tree_hash_mmap_tl_t<Key, Mapped, _Alloc>::type
207 typename detail::tree_lu_mmap_tl_t<Key, Mapped, _Alloc>::type
212 typename __gnu_cxx::typelist::append<hl_mmap_tl_t,
213 typename __gnu_cxx::typelist::append<hh_mmap_tl_t,
214 typename __gnu_cxx::typelist::append<th_mmap_tl_t,
215 tl_mmap_tl_t>::type>::type>::type
220 } // namespace __gnu_pbds