.. SPDX-FileCopyrightText: 2019-2020 Intel Corporation .. .. SPDX-License-Identifier: CC-BY-4.0 ================ Deduction guides ================ Where possible, constructors of ``concurrent_hash_map`` support class template argument deduction (since C++17): .. code:: cpp template >> concurrent_hash_map( InputIterator, InputIterator, const HashCompare&, const Allocator& = Allocator() ) -> concurrent_hash_map, iterator_mapped_t, HashCompare, Allocator>; template >> concurrent_hash_map( InputIterator, InputIterator, const Allocator& = Allocator() ) -> concurrent_hash_map, iterator_mapped_t, tbb_hash_compare>, Allocator>; template >> concurrent_hash_map( std::initializer_list>, const HashCompare&, const Allocator& = Allocator() ) -> concurrent_hash_map; template >> concurrent_hash_map( std::initializer_list>, const Allocator& = Allocator() ) -> concurrent_hash_map, Allocator>; Where the type aliases ``iterator_key_t``, ``iterator_mapped_t``, and ``iterator_alloc_value_t`` are defined as follows: .. code:: cpp template using iterator_key_t = std::remove_const_t::value_type::first_type>; template using iterator_mapped_t = typename std::iterator_traits::value_type::second_type; template using iterator_alloc_value_t = std::pair, iterator_mapped_t>>; **Example** .. code:: cpp #include #include int main() { std::vector> v; // Deduces chmap1 as tbb::concurrent_hash_map tbb::concurrent_hash_map chmap1(v.begin(), v.end()); std::allocator> alloc; // Deduces chmap2 as tbb::concurrent_hash_map, // std::allocator>> tbb::concurrent_hash_map chmap2(v.begin(), v.end(), alloc); }