.. SPDX-FileCopyrightText: 2019-2021 Intel Corporation .. .. SPDX-License-Identifier: CC-BY-4.0 ================ Deduction guides ================ If possible, ``oneapi::tbb::concurrent_priority_queue`` 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 Allocator = tbb::cache_aligned_allocator>> concurrent_priority_queue( InputIterator, InputIterator, Compare = Compare(), Allocator = Allocator() ) -> concurrent_priority_queue, Compare, Allocator>; template concurrent_priority_queue( InputIterator, InputIterator, Allocator ) -> concurrent_priority_queue, std::less>, Allocator>; template , typename Allocator = tbb::cache_aligned_allocator> concurrent_priority_queue( std::initializer_list, Compare = Compare(), Allocator = Allocator() ) -> concurrent_priority_queue; template concurrent_priority_queue( std::initializer_list, Allocator ) -> concurrent_priority_queue, Allocator>; Where the type alias ``iterator_value_t`` is defined as follows: .. code:: cpp template using iterator_value_t = typename std::iterator_traits::value_type; 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 ``Compare`` type does not meet the ``Allocator`` requirements. **Example** .. code:: cpp #include #include #include int main() { std::vector vec; // Deduces cpq1 as oneapi::tbb::concurrent_priority_queue oneapi::tbb::concurrent_priority_queue cpq1(vec.begin(), vec.end()); // Deduces cpq2 as oneapi::tbb::concurrent_priority_queue oneapi::tbb::concurrent_priority_queue cpq2(vec.begin(), vec.end(), std::greater{}); }