Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[oneTBB] Changing description for containers deduction guides #355

Merged
merged 5 commits into from
Sep 6, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@ Deduction guides
================

Where possible, constructors of ``tbb::concurrent_bounded_queue`` support class template argument
deduction (since C++17):
deduction (since C++17). Copy and move constructors (including constructors with explicit
kboyarinov marked this conversation as resolved.
Show resolved Hide resolved
``allocator_type`` argument) provides implicitly generated deduction guides. In addition, the following explicit
kboyarinov marked this conversation as resolved.
Show resolved Hide resolved
deduction guides are provided:

.. code:: cpp

template <typename InputIterator,
typename Allocator = cache_aligned_allocator<iterator_value_t<InputIterator>>
concurrent_bounded_queue( InputIterator, InputIterator, const Allocator& = Allocator() )
-> concurrent_bounded_queue<iterator_value_t<InputIterator>, Allocator>;
typename Allocator = tbb::cache_aligned_allocator<iterator_value_t<InputIterator>>
concurrent_bounded_queue( InputIterator, InputIterator,
Allocator = Allocator() )
kboyarinov marked this conversation as resolved.
Show resolved Hide resolved
-> concurrent_bounded_queue<iterator_value_t<InputIterator>,
Allocator>;

Where the type alias ``iterator_value_t`` is defined as follows:

Expand All @@ -23,6 +27,11 @@ Where the type alias ``iterator_value_t`` is defined as follows:
template <typename InputIterator>
using iterator_value_t = typename std::iterator_traits<InputIterator>::value_type;

These deduction guides only participates in overload resolution if all of the following are ``true``:
kboyarinov marked this conversation as resolved.
Show resolved Hide resolved

* The type ``InputIterator`` meets the requirements of ``InputIterator`` from the [input.iterators] ISO C++ Standard section.
kboyarinov marked this conversation as resolved.
Show resolved Hide resolved
* The type ``Allocator`` meets the requirements of ``Allocator`` from the [allocator.requirements] ISO C++ Standard section.
kboyarinov marked this conversation as resolved.
Show resolved Hide resolved

**Example**

.. code:: cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Class Template Synopsis
using pointer = typename std::allocator_traits<Allocator>::pointer;
using const_pointer = typename std::allocator_traits<Allocator>::const_pointer;

using hash_compare_type = HashCompare;
using allocator_type = Allocator;

using size_type = <implementation-defined unsigned integer type>;
Expand All @@ -50,31 +51,31 @@ Class Template Synopsis
// Construction, destruction, copying
concurrent_hash_map();

explicit concurrent_hash_map( const HashCompare& compare,
explicit concurrent_hash_map( const hash_compare_type& compare,
const allocator_type& alloc = allocator_type() );

explicit concurrent_hash_map( const allocator_type& alloc );

concurrent_hash_map( size_type n, const HashCompare& compare,
concurrent_hash_map( size_type n, const hash_compare_type& compare,
const allocator_type& alloc = allocator_type() );

concurrent_hash_map( size_type n, const allocator_type& alloc = allocator_type() );

template <typename InputIterator>
concurrent_hash_map( InputIterator first, InputIterator last,
const HashCompare& compare,
const hash_compare_type& compare,
const allocator_type& alloc = allocator_type() );

template <typename InputIterator>
concurrent_hash_map( InputIterator first, InputIterator last,
const allocator_type& alloc = allocator_type() );

concurrent_hash_map( std::initializer_list<value_type> init,
const HashCompare& compare,
const hash_compare_type& compare = hash_compare_type(),
const allocator_type& alloc = allocator_type() );

concurrent_hash_map( std::initializer_list<value_type> init,
const allocator_type& alloc = allocator_type() );
const allocator_type& alloc );

concurrent_hash_map( const concurrent_hash_map& other );
concurrent_hash_map( const concurrent_hash_map& other,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Empty container constructors

concurrent_hash_map();

explicit concurrent_hash_map( const HashCompare& compare,
explicit concurrent_hash_map( const hash_compare_type& compare,
const allocator_type& alloc = allocator_type() );

explicit concurrent_hash_map( const allocator_type& alloc );
Expand All @@ -28,7 +28,7 @@ Empty container constructors

.. code:: cpp

concurrent_hash_map( size_type n, const HashCompare& compare,
concurrent_hash_map( size_type n, const hash_compare_type& compare,
const allocator_type& alloc = allocator_type() );

concurrent_hash_map( size_type n, const allocator_type& alloc = allocator_type() );
Expand All @@ -45,7 +45,7 @@ Constructors from the sequence of elements

template <typename InputIterator>
concurrent_hash_map( InputIterator first, InputIterator last,
const HashCompare& compare,
const hash_compare_type& compare,
const allocator_type& alloc = allocator_type() );

template <typename InputIterator>
Expand All @@ -70,7 +70,7 @@ Constructors from the sequence of elements
.. code:: cpp

concurrent_hash_map( std::initializer_list<value_type> init,
const HashCompare& compare,
const hash_compare_type& compare = hash_compare_type(),
const allocator_type& alloc = allocator_type() );

Equivalent to ``concurrent_hash_map(init.begin(), init.end(), compare, alloc)``.
Expand All @@ -80,7 +80,7 @@ Constructors from the sequence of elements
.. code:: cpp

concurrent_hash_map( std::initializer_list<value_type> init,
const allocator_type& alloc = allocator_type() );
const allocator_type& alloc );

Equivalent to ``concurrent_hash_map(init.begin(), init.end(), alloc)``.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,51 +7,50 @@ Deduction guides
================

Where possible, constructors of ``concurrent_hash_map`` support
class template argument deduction (since C++17):
class template argument deduction (since C++17). Copy and move constructors (including constructors with explicit
kboyarinov marked this conversation as resolved.
Show resolved Hide resolved
``allocator_type`` argument) provides implicitly generated deduction guides. In addition, the following explicit
kboyarinov marked this conversation as resolved.
Show resolved Hide resolved
deduction guides are provided:

.. code:: cpp

template <typename InputIterator,
typename HashCompare,
typename Allocator = tbb_allocator<iterator_alloc_value_t<InputIterator>>>
typename HashCompare = tbb_hash_compare<iterator_key_t<InputIterator>>,
typename Alloc = tbb_allocator<iterator_alloc_value_t<InputIterator>>>
concurrent_hash_map( InputIterator, InputIterator,
const HashCompare&,
const Allocator& = Allocator() )
HashCompare = HashCompare(),
Alloc = Alloc() )
-> concurrent_hash_map<iterator_key_t<InputIterator>,
iterator_mapped_t<InputIterator>,
HashCompare,
Allocator>;
Alloc>;

template <typename InputIterator,
typename Allocator = tbb_allocator<iterator_alloc_value_t<InputIterator>>>
concurrent_hash_map( InputIterator, InputIterator,
const Allocator& = Allocator() )
typename Alloc>
concurrent_hash_map( InputIterator, InputIterator, Alloc )
-> concurrent_hash_map<iterator_key_t<InputIterator>,
iterator_mapped_t<InputIterator>,
tbb_hash_compare<iterator_key_t<InputIterator>>,
Allocator>;

template <typename Key,
typename T,
typename HashCompare,
typename Allocator = tbb_allocator<std::pair<const Key, T>>>
concurrent_hash_map( std::initializer_list<std::pair<const Key, T>>,
const HashCompare&,
const Allocator& = Allocator() )
-> concurrent_hash_map<Key,
Alloc>;

template <typename Key, typename T,
typename HashCompare = tbb_hash_compare<std::remove_const_t<Key>>,
typename Alloc = tbb_allocator<std::pair<const Key, T>>>
concurrent_hash_map( std::initializer_list<std::pair<Key, T>>,
HashCompare = HashCompare(),
Alloc = Alloc() )
-> concurrent_hash_map<std::remove_const_t<Key>,
T,
HashCompare,
Allocator>;

template <typename Key,
typename T,
typename Allocator = tbb_allocator<std::pair<const Key, T>>>
concurrent_hash_map( std::initializer_list<std::pair<const Key, T>>,
const Allocator& = Allocator() )
-> concurrent_hash_map<Key,
Alloc>;

template <typename Key, typename T,
typename Alloc>
concurrent_hash_map( std::initializer_list<std::pair<Key, T>>,
Alloc )
-> concurrent_hash_map<std::remove_const_t<Key>,
T,
tbb_hash_compare<Key>,
Allocator>;
tbb_hash_compare<std::remove_const_t<Key>>,
Alloc>;

Where the type aliases ``iterator_key_t``, ``iterator_mapped_t``, and ``iterator_alloc_value_t``
are defined as follows:
Expand All @@ -68,6 +67,12 @@ are defined as follows:
using iterator_alloc_value_t = std::pair<std::add_const_t<iterator_key_t<InputIterator>,
iterator_mapped_t<InputIterator>>>;

These deduction guides only participates in overload resolution if all of the following are ``true``:
kboyarinov marked this conversation as resolved.
Show resolved Hide resolved

* The type ``InputIterator`` meets the requirements of ``InputIterator`` from the [input.iterators] ISO C++ Standard section.
kboyarinov marked this conversation as resolved.
Show resolved Hide resolved
* The type ``Alloc`` meets the requirements of ``Allocator`` from the [allocator.requirements] ISO C++ Standard section.
kboyarinov marked this conversation as resolved.
Show resolved Hide resolved
* The type ``HashCompare`` does not meet the requirements of ``Allocator``.
kboyarinov marked this conversation as resolved.
Show resolved Hide resolved

**Example**

.. code:: cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,51 @@
Deduction guides
================

Where possible, constructors of ``concurrent_map`` support class template argument
deduction (since C++17):
Where possible, constructors of ``concurrent_map`` support
kboyarinov marked this conversation as resolved.
Show resolved Hide resolved
class template argument deduction (since C++17). Copy and move constructors (including constructors with explicit
kboyarinov marked this conversation as resolved.
Show resolved Hide resolved
``allocator_type`` argument) provides implicitly generated deduction guides. In addition, the following explicit
kboyarinov marked this conversation as resolved.
Show resolved Hide resolved
deduction guides are provided:

.. code:: cpp

template <typename InputIterator,
typename Compare = std::less<iterator_key_t<InputIterator>>,
typename Allocator = tbb_allocator<iterator_alloc_value_t<InputIterator>>>
concurrent_map( InputIterator, InputIterator, Compare = Compare(), Allocator = Allocator() )
concurrent_map( InputIterator, InputIterator,
Compare = Compare(),
Allocator = Allocator() )
-> concurrent_map<iterator_key_t<InputIterator>,
iterator_mapped_t<InputIterator>,
Compare,
Allocator>;

template <typename InputIterator,
typename Allocator>
concurrent_map( InputIterator, InputIterator, Allocator )
concurrent_map( InputIterator, InputIterator,
Allocator )
-> concurrent_map<iterator_key_t<InputIterator>,
iterator_mapped_t<InputIterator>,
std::less<iterator_key_t<InputIterator>>,
Allocator>;

template <typename Key,
typename T,
typename Compare = std::less<Key>,
template <typename Key, typename T,
typename Compare = std::less<std::remove_const_t<Key>>,
typename Allocator = tbb_allocator<std::pair<const Key, T>>>
concurrent_map( std::initializer_list<std::pair<Key, T>>, Compare = Compare(), Allocator = Allocator() )
-> concurrent_map<Key, T, Compare, Allocator>;
concurrent_map( std::initializer_list<std::pair<Key, T>>,
Compare = Compare(),
Allocator = Allocator() )
-> concurrent_map<std::remove_const_t<Key>,
T,
Compare,
Allocator>;

template <typename Key,
typename T,
template <typename Key, typename T,
typename Allocator>
concurrent_map( std::initializer_list<std::pair<Key, T>>, Allocator )
-> concurrent_map<Key, T, std::less<Key>, Allocator>;
-> concurrent_map<std::remove_const_t<Key>,
T,
std::less<std::remove_const_t<Key>>,
Allocator>;

where the type aliases ``iterator_key_t``, ``iterator_mapped_t``, ``iterator_alloc_value_t`` are defined as follows:

Expand All @@ -55,6 +66,12 @@ where the type aliases ``iterator_key_t``, ``iterator_mapped_t``, ``iterator_all
using iterator_alloc_value_t = std::pair<std::add_const_t<iterator_key_t<InputIterator>>,
iterator_mapped_t<InputIterator>>;

These deduction guides only participates in overload resolution if all of the following are ``true``:
kboyarinov marked this conversation as resolved.
Show resolved Hide resolved

* The type ``InputIterator`` meets the requirements of ``InputIterator`` from the [input.iterators] ISO C++ Standard section.
kboyarinov marked this conversation as resolved.
Show resolved Hide resolved
* The type ``Allocator`` meets the requirements of ``Allocator`` from the [allocator.requirements] ISO C++ Standard section.
kboyarinov marked this conversation as resolved.
Show resolved Hide resolved
* The type ``Compare`` does not meet the requirements of ``Allocator``.
kboyarinov marked this conversation as resolved.
Show resolved Hide resolved

**Example**

.. code:: cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,51 @@
Deduction guides
================

Where possible, constructors of ``concurrent_multimap`` support class template argument
deduction (since C++17):
Where possible, constructors of ``concurrent_multimap`` support
kboyarinov marked this conversation as resolved.
Show resolved Hide resolved
class template argument deduction (since C++17). Copy and move constructors (including constructors with explicit
kboyarinov marked this conversation as resolved.
Show resolved Hide resolved
``allocator_type`` argument) provides implicitly generated deduction guides. In addition, the following explicit
kboyarinov marked this conversation as resolved.
Show resolved Hide resolved
deduction guides are provided:

.. code:: cpp

template <typename InputIterator,
typename Compare = std::less<iterator_key_t<InputIterator>>,
typename Allocator = tbb_allocator<iterator_alloc_value_t<InputIterator>>>
concurrent_multimap( InputIterator, InputIterator, Compare = Compare(), Allocator = Allocator() )
concurrent_multimap( InputIterator, InputIterator,
Compare = Compare(),
Allocator = Allocator() )
-> concurrent_multimap<iterator_key_t<InputIterator>,
iterator_mapped_t<InputIterator>,
Compare,
Allocator>;

template <typename InputIterator,
typename Allocator>
concurrent_multimap( InputIterator, InputIterator, Allocator )
concurrent_multimap( InputIterator, InputIterator,
Allocator )
-> concurrent_multimap<iterator_key_t<InputIterator>,
iterator_mapped_t<InputIterator>,
std::less<iterator_key_t<InputIterator>>,
Allocator>;

template <typename Key,
typename T,
typename Compare = std::less<Key>,
template <typename Key, typename T,
typename Compare = std::less<std::remove_const_t<Key>>,
typename Allocator = tbb_allocator<std::pair<const Key, T>>>
concurrent_multimap( std::initializer_list<std::pair<Key, T>>, Compare = Compare(), Allocator = Allocator() )
-> concurrent_multimap<Key, T, Compare, Allocator>;
concurrent_multimap( std::initializer_list<std::pair<Key, T>>,
Compare = Compare(),
Allocator = Allocator() )
-> concurrent_multimap<std::remove_const_t<Key>,
T,
Compare,
Allocator>;

template <typename Key,
typename T,
template <typename Key, typename T,
typename Allocator>
concurrent_multimap( std::initializer_list<std::pair<Key, T>>, Allocator )
-> concurrent_multimap<Key, T, std::less<Key>, Allocator>;
-> concurrent_multimap<std::remove_const_t<Key>,
T,
std::less<std::remove_const_t<Key>>,
Allocator>;

where the type aliases ``iterator_key_t``, ``iterator_mapped_t``, ``iterator_alloc_value_t`` are defined as follows:

Expand All @@ -55,6 +66,12 @@ where the type aliases ``iterator_key_t``, ``iterator_mapped_t``, ``iterator_all
using iterator_alloc_value_t = std::pair<std::add_const_t<iterator_key_t<InputIterator>>,
iterator_mapped_t<InputIterator>>;

These deduction guides only participates in overload resolution if all of the following are ``true``:
kboyarinov marked this conversation as resolved.
Show resolved Hide resolved

* The type ``InputIterator`` meets the requirements of ``InputIterator`` from the [input.iterators] ISO C++ Standard section.
kboyarinov marked this conversation as resolved.
Show resolved Hide resolved
* The type ``Allocator`` meets the requirements of ``Allocator`` from the [allocator.requirements] ISO C++ Standard section.
kboyarinov marked this conversation as resolved.
Show resolved Hide resolved
* The type ``Compare`` does not meet the requirements of ``Allocator``.
kboyarinov marked this conversation as resolved.
Show resolved Hide resolved

**Example**

.. code:: cpp
Expand Down
Loading