Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-30 08:46:16

0001 /*
0002     Copyright (c) 2005-2021 Intel Corporation
0003 
0004     Licensed under the Apache License, Version 2.0 (the "License");
0005     you may not use this file except in compliance with the License.
0006     You may obtain a copy of the License at
0007 
0008         http://www.apache.org/licenses/LICENSE-2.0
0009 
0010     Unless required by applicable law or agreed to in writing, software
0011     distributed under the License is distributed on an "AS IS" BASIS,
0012     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0013     See the License for the specific language governing permissions and
0014     limitations under the License.
0015 */
0016 
0017 #ifndef __TBB_detail__containers_helpers_H
0018 #define __TBB_detail__containers_helpers_H
0019 
0020 #include "_template_helpers.h"
0021 #include "_allocator_traits.h"
0022 #include <type_traits>
0023 #include <memory>
0024 #include <functional>
0025 
0026 namespace tbb {
0027 namespace detail {
0028 inline namespace d0 {
0029 
0030 template <typename Compare, typename = void>
0031 struct comp_is_transparent : std::false_type {};
0032 
0033 template <typename Compare>
0034 struct comp_is_transparent<Compare, tbb::detail::void_t<typename Compare::is_transparent>> : std::true_type {};
0035 
0036 template <typename Key, typename Hasher, typename KeyEqual, typename = void >
0037 struct has_transparent_key_equal : std::false_type { using type = KeyEqual; };
0038 
0039 template <typename Key, typename Hasher, typename KeyEqual>
0040 struct has_transparent_key_equal<Key, Hasher, KeyEqual, tbb::detail::void_t<typename Hasher::transparent_key_equal>> : std::true_type {
0041     using type = typename Hasher::transparent_key_equal;
0042     static_assert(comp_is_transparent<type>::value, "Hash::transparent_key_equal::is_transparent is not valid or does not denote a type.");
0043     static_assert((std::is_same<KeyEqual, std::equal_to<Key>>::value ||
0044         std::is_same<typename Hasher::transparent_key_equal, KeyEqual>::value), "KeyEqual is a different type than equal_to<Key> or Hash::transparent_key_equal.");
0045  };
0046 
0047 struct is_iterator_impl {
0048 template <typename T>
0049 using iter_traits_category = typename std::iterator_traits<T>::iterator_category;
0050 
0051 template <typename T>
0052 using input_iter_category = typename std::enable_if<std::is_base_of<std::input_iterator_tag, iter_traits_category<T>>::value>::type;
0053 }; // struct is_iterator_impl
0054 
0055 template <typename T>
0056 using is_input_iterator = supports<T, is_iterator_impl::iter_traits_category, is_iterator_impl::input_iter_category>;
0057 
0058 #if __TBB_CPP17_DEDUCTION_GUIDES_PRESENT
0059 template <typename T>
0060 inline constexpr bool is_input_iterator_v = is_input_iterator<T>::value;
0061 #endif
0062 
0063 } // inline namespace d0
0064 } // namespace detail
0065 } // namespace tbb
0066 
0067 #endif // __TBB_detail__containers_helpers_H