/usr/include/oneapi/tbb/detail
NameSizeModeActions
_aggregator.h75620644editdlrm
_aligned_space.h13990644editdlrm
_allocator_traits.h38070644editdlrm
_assert.h23920644editdlrm
_concurrent_queue_base.h263600644editdlrm
_concurrent_skip_list.h466280644editdlrm
_concurrent_unordered_base.h646560644editdlrm
_config.h203820644editdlrm
_containers_helpers.h26270644editdlrm
_exception.h27150644editdlrm
_export.h11990644editdlrm
_flow_graph_body_impl.h127760644editdlrm
_flow_graph_cache_impl.h136150644editdlrm
_flow_graph_impl.h153600644editdlrm
_flow_graph_indexer_impl.h165290644editdlrm
_flow_graph_item_buffer_impl.h103590644editdlrm
_flow_graph_join_impl.h828860644editdlrm
_flow_graph_nodes_deduction.h95320644editdlrm
_flow_graph_node_impl.h275450644editdlrm
_flow_graph_node_set_impl.h101770644editdlrm
_flow_graph_tagged_buffer_impl.h103180644editdlrm
_flow_graph_trace_impl.h159740644editdlrm
_flow_graph_types_impl.h156230644editdlrm
_hash_compare.h44880644editdlrm
_intrusive_list_node.h14620644editdlrm
_machine.h130420644editdlrm
_mutex_common.h23470644editdlrm
_namespace_injection.h8150644editdlrm
_node_handle.h51730644editdlrm
_pipeline_filters.h159050644editdlrm
_pipeline_filters_deduction.h15290644editdlrm
_range_common.h46430644editdlrm
_rtm_mutex.h47850644editdlrm
_rtm_rw_mutex.h72100644editdlrm
_scoped_lock.h50090644editdlrm
_segment_table.h247500644editdlrm
_small_object_pool.h35740644editdlrm
_string_resource.h38720644editdlrm
_task.h71160644editdlrm
_task_handle.h36880644editdlrm
_template_helpers.h135170644editdlrm
_utils.h133180644editdlrm
_waitable_atomic.h35320644editdlrm
Edit: /usr/include/oneapi/tbb/detail/_hash_compare.h (4488B)
/* Copyright (c) 2005-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #ifndef __TBB_detail__hash_compare_H #define __TBB_detail__hash_compare_H #include #include "_containers_helpers.h" namespace tbb { namespace detail { namespace d1 { template class hash_compare { using is_transparent_hash = has_transparent_key_equal; public: using hasher = Hash; using key_equal = typename is_transparent_hash::type; hash_compare() = default; hash_compare( hasher hash, key_equal equal ) : my_hasher(hash), my_equal(equal) {} std::size_t operator()( const Key& key ) const { return std::size_t(my_hasher(key)); } bool operator()( const Key& key1, const Key& key2 ) const { return my_equal(key1, key2); } template ::type> std::size_t operator()( const K& key ) const { return std::size_t(my_hasher(key)); } template ::type> bool operator()( const K1& key1, const K2& key2 ) const { return my_equal(key1, key2); } hasher hash_function() const { return my_hasher; } key_equal key_eq() const { return my_equal; } private: hasher my_hasher; key_equal my_equal; }; // class hash_compare //! hash_compare that is default argument for concurrent_hash_map template class tbb_hash_compare { public: std::size_t hash( const Key& a ) const { return my_hash_func(a); } #if defined(_MSC_VER) && _MSC_VER <= 1900 #pragma warning (push) // MSVC 2015 throws a strange warning: 'std::size_t': forcing value to bool 'true' or 'false' #pragma warning (disable: 4800) #endif bool equal( const Key& a, const Key& b ) const { return my_key_equal(a, b); } #if defined(_MSC_VER) && _MSC_VER <= 1900 #pragma warning (pop) #endif private: std::hash my_hash_func; std::equal_to my_key_equal; }; } // namespace d1 #if __TBB_CPP20_CONCEPTS_PRESENT inline namespace d0 { template concept hash_compare = std::copy_constructible && requires( const std::remove_reference_t& hc, const Key& key1, const Key& key2 ) { { hc.hash(key1) } -> std::same_as; { hc.equal(key1, key2) } -> std::convertible_to; }; } // namespace d0 #endif // __TBB_CPP20_CONCEPTS_PRESENT } // namespace detail } // namespace tbb #if TBB_DEFINE_STD_HASH_SPECIALIZATIONS namespace std { template struct hash> { public: std::size_t operator()( const std::pair& p ) const { return first_hash(p.first) ^ second_hash(p.second); } private: std::hash first_hash; std::hash second_hash; }; // struct hash // Apple clang and MSVC defines their own specializations for std::hash> #if !(_LIBCPP_VERSION) && !(_CPPLIB_VER) template struct hash> { public: std::size_t operator()( const std::basic_string& s ) const { std::size_t h = 0; for ( const CharT* c = s.c_str(); *c; ++c ) { h = h * hash_multiplier ^ char_hash(*c); } return h; } private: static constexpr std::size_t hash_multiplier = tbb::detail::select_size_t_constant<2654435769U, 11400714819323198485ULL>::value; std::hash char_hash; }; // struct hash #endif // !(_LIBCPP_VERSION || _CPPLIB_VER) } // namespace std #endif // TBB_DEFINE_STD_HASH_SPECIALIZATIONS #endif // __TBB_detail__hash_compare_H