libstdc++
GNU C++ library
Loading...
Searching...
No Matches

◆ make_pair() [2/2]

template<typename _T1, typename _T2>
pair< typename __decay_and_strip< _T1 >::__type, typename __decay_and_strip< _T2 >::__type > std::make_pair ( _T1 && __x,
_T2 && __y )
constexpr

A convenience wrapper for creating a pair from two objects.

Parameters
__xThe first object.
__yThe second object.
Returns
A newly-constructed pair<> object of the appropriate type.

The C++98 standard says the objects are passed by reference-to-const, but C++03 says they are passed by value (this was LWG issue #181).

Since C++11 they have been passed by forwarding reference and then forwarded to the new members of the pair. To create a pair with a member of reference type, pass a reference_wrapper to this function.

Definition at line 1166 of file stl_pair.h.

1167 {
1168 typedef typename __decay_and_strip<_T1>::__type __ds_type1;
1169 typedef typename __decay_and_strip<_T2>::__type __ds_type2;
1170 typedef pair<__ds_type1, __ds_type2> __pair_type;
1171 return __pair_type(std::forward<_T1>(__x), std::forward<_T2>(__y));
1172 }
constexpr _Tp && forward(typename std::remove_reference< _Tp >::type &__t) noexcept
Forward an lvalue.
Definition move.h:72
Struct holding two objects of arbitrary type.
Definition stl_pair.h:304

References forward(), and make_pair().

Referenced by __pstl::__internal::__brick_calc_mask_1(), __pstl::__internal::__brick_calc_mask_1(), __pstl::__internal::__brick_transform_scan(), __pstl::__internal::__brick_transform_scan(), __gnu_parallel::__find_template(), __gen_two_uniform_ints(), __gnu_debug::__get_distance(), __gnu_debug::__get_distance(), __minmax_element(), __pstl::__internal::__mismatch_serial(), std::__parallel::__mismatch_switch(), std::__parallel::__mismatch_switch(), __gnu_parallel::__parallel_merge_advance(), __gnu_parallel::__parallel_set_operation(), __gnu_parallel::__parallel_sort_qsb(), __pstl::__internal::__pattern_minmax_element(), __pstl::__internal::__pattern_mismatch(), __pstl::__internal::__pattern_partition_copy(), __gnu_parallel::__qsb_local_sort_with_helping(), __pstl::__unseq_backend::__simd_first(), __pstl::__unseq_backend::__simd_minmax_element(), __pstl::__unseq_backend::__simd_partition_copy(), __pstl::__unseq_backend::__simd_scan(), __pstl::__unseq_backend::__simd_scan(), __pstl::__unseq_backend::__simd_scan(), __pstl::__unseq_backend::__simd_scan(), __gnu_debug::_Safe_iterator< _Iterator, _Sequence, _Category >::_M_get_distance_from_begin(), __gnu_debug::_Safe_iterator< _Iterator, _Sequence, _Category >::_M_get_distance_to(), __gnu_debug::_Safe_iterator< _Iterator, _Sequence, _Category >::_M_get_distance_to_end(), std::tr1::_Hashtable< _Key, _Value, _Allocator, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, __cache_hash_code, __constant_iterators, __unique_keys >::_M_insert(), std::__detail::_BracketMatcher< _TraitsT, __icase, __collate >::_M_make_range(), std::tr1::__detail::_Prime_rehash_policy::_M_need_rehash(), __gnu_parallel::__adjacent_find_selector::_M_sequential_algorithm(), __gnu_parallel::__find_first_of_selector< _FIterator >::_M_sequential_algorithm(), __gnu_parallel::__find_if_selector::_M_sequential_algorithm(), __gnu_debug::_Safe_iterator< _Iterator, _Sequence, _Category >::_M_valid_range(), __gnu_debug::_Safe_iterator< _Iterator, _Sequence, std::random_access_iterator_tag >::_M_valid_range(), __gnu_cxx::bitmap_allocator< _Tp1 >::_S_refill_pool(), __gnu_debug::_Sequence_traits< _Sequence >::_S_size(), __gnu_debug::_Sequence_traits< std::__debug::forward_list< _Tp, _Alloc > >::_S_size(), __gnu_cxx::annotate_base::check_constructed(), std::__debug::map< _Key, _Tp, _Compare, _Allocator >::equal_range(), std::__debug::map< _Key, _Tp, _Compare, _Allocator >::equal_range(), std::__debug::multimap< _Key, _Tp, _Compare, _Allocator >::equal_range(), std::__debug::multimap< _Key, _Tp, _Compare, _Allocator >::equal_range(), std::__debug::multiset< _Key, _Compare, _Allocator >::equal_range(), std::__debug::multiset< _Key, _Compare, _Allocator >::equal_range(), std::__debug::set< _Key, _Compare, _Allocator >::equal_range(), std::__debug::set< _Key, _Compare, _Allocator >::equal_range(), std::tr1::_Hashtable< _Key, _Value, _Allocator, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, __cache_hash_code, __constant_iterators, __unique_keys >::equal_range(), std::tr1::_Hashtable< _Key, _Value, _Allocator, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, __cache_hash_code, __constant_iterators, __unique_keys >::equal_range(), __gnu_pbds::detail::ov_tree_map< Key, Mapped, at0t, at1t, _Alloc >::insert(), __gnu_cxx::annotate_base::insert_construct(), __gnu_cxx::annotate_base::make_entry(), make_pair(), minmax(), minmax(), __gnu_parallel::multiseq_partition(), __gnu_parallel::multiseq_selection(), __gnu_parallel::_SplitConsistently< true, _RAIter, _Compare, _SortingPlacesIterator >::operator()(), __gnu_pbds::detail::ranged_hash_fn< Key, Hash_Fn, _Alloc, Comb_Hash_Fn, true >::operator()(), __gnu_pbds::detail::ranged_hash_fn< Key, Hash_Fn, _Alloc, Comb_Hash_Fn, true >::operator()(), __gnu_pbds::detail::ranged_probe_fn< Key, Hash_Fn, _Alloc, Comb_Probe_Fn, Probe_Fn, true >::operator()(), std::default_searcher< _ForwardIterator1, _BinaryPredicate >::operator()(), __gnu_pbds::detail::lu_map< Key, Mapped, at0t, _Alloc, at1t >::operator[](), __gnu_pbds::detail::ov_tree_map< Key, Mapped, at0t, at1t, _Alloc >::operator[](), __gnu_pbds::detail::pat_trie_map< Key, Mapped, at1t, _Alloc >::operator[](), std::tr1::__detail::_Map_base< _Key, _Pair, std::_Select1st< _Pair >, true, _Hashtable >::operator[](), __gnu_parallel::parallel_multiway_merge(), __gnu_parallel::parallel_sort_mwms_pu(), and __gnu_pbds::detail::pat_trie_base::_Node_citer< node, leaf, head, inode, const_iterator, iterator, _Alloc >::valid_prefix().

Here is the call graph for this function:
Here is the caller graph for this function: