.. SPDX-FileCopyrightText: 2019-2021 Intel Corporation .. .. SPDX-License-Identifier: CC-BY-4.0 ================ Deduction guides ================ If possible, ``concurrent_unordered_multimap`` constructors support class template argument deduction (since C++17). Copy and move constructors, including constructors with an explicit ``allocator_type`` argument, provide implicitly-generated deduction guides. In addition, the following explicit deduction guides are provided: .. code:: cpp template >, typename KeyEqual = std::equal_to>, typename Allocator = tbb::tbb_allocator>> concurrent_unordered_multimap( InputIterator, InputIterator, map_size_type = {}, Hash = Hash(), KeyEqual = KeyEqual(), Allocator = Allocator() ) -> concurrent_unordered_multimap, iterator_mapped_t, Hash, KeyEqual, Allocator>; template concurrent_unordered_multimap( InputIterator, InputIterator, map_size_type, Hash, Allocator ) -> concurrent_unordered_multimap, iterator_mapped_t, Hash, std::equal_to>, Allocator>; template concurrent_unordered_multimap( InputIterator, InputIterator, map_size_type, Allocator ) -> concurrent_unordered_multimap, iterator_mapped_t, std::hash>, std::equal_to>, Allocator>; template >, typename KeyEqual = std::equal_to>, typename Allocator = tbb::tbb_allocator>> concurrent_unordered_multimap( std::initializer_list>, map_size_type = {}, Hash = Hash(), KeyEqual = KeyEqual(), Allocator = Allocator() ) -> concurrent_unordered_multimap, T, Hash, KeyEqual, Allocator>; template concurrent_unordered_multimap( std::initializer_list>, map_size_type, Allocator ) -> concurrent_unordered_multimap, T, std::hash>, std::equal_to>, Allocator>; template concurrent_unordered_multimap( std::initializer_list>, Allocator ) -> concurrent_unordered_multimap, T, std::hash>, std::equal_to>, Allocator>; template concurrent_unordered_multimap( std::initializer_list>, map_size_type, Hash, Allocator ) -> concurrent_unordered_multimap, T, Hash, std::equal_to>, Allocator>; Where the ``map_size_type`` type refers to the ``size_type`` member type of the deduced ``concurrent_unordered_multimap`` and 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>>; These deduction guides only participate in the overload resolution if the following requirements are met: * The ``InputIterator`` type meets the ``InputIterator`` requirements described in the [input.iterators] section of the ISO C++ Standard. * The ``Allocator`` type meets the ``Allocator`` requirements described in the [allocator.requirements] section of the ISO C++ Standard. * The ``Hash`` type does not meet the ``Allocator`` requirements. * The ``KeyEqual`` type does not meet the ``Allocator`` requirements. **Example** .. code:: cpp #include #include #include struct CustomHasher {...}; int main() { std::vector> v; // Deduces m1 as concurrent_unordered_multimap oneapi::tbb::concurrent_unordered_multimap m1(v.begin(), v.end()); // Deduces m2 as concurrent_unordered_multimap; oneapi::tbb::concurrent_unordered_multimap m2(v.begin(), v.end(), CustomHasher{}); }