|
835 | 835 | \begin{codeblock}
|
836 | 836 | !is_convertible_v<U1, T1> || !is_convertible_v<U2, T2>
|
837 | 837 | \end{codeblock}
|
| 838 | +This constructor is defined as deleted if |
| 839 | +\tcode{reference_constructs_from_temporary_v<first_type, U1\&\&>} |
| 840 | +is \tcode{true} or |
| 841 | +\tcode{reference_constructs_from_temporary_v<second_type, U2\&\&>} |
| 842 | +is \tcode{true}. |
838 | 843 | \end{itemdescr}
|
839 | 844 |
|
840 | 845 | \indexlibraryctor{pair}%
|
|
872 | 877 | !is_convertible_v<decltype(get<0>(@\exposid{FWD}@(p))), T1> ||
|
873 | 878 | !is_convertible_v<decltype(get<1>(@\exposid{FWD}@(p))), T2>
|
874 | 879 | \end{codeblock}
|
| 880 | +The constructor is defined as deleted if |
| 881 | +\tcode{reference_constructs_from_temporary_v<first_type, decltype(get<0>(FWD(p)))>} |
| 882 | +is \tcode{true} or |
| 883 | +\tcode{reference_constructs_from_temporary_v<second_type, decltype(get<1>(FWD(p)))>} |
| 884 | +is \tcode{true}. |
875 | 885 | \end{itemdescr}
|
876 | 886 |
|
877 | 887 | \indexlibraryctor{pair}%
|
|
899 | 909 | \tcode{std::forward<U>(x)}.) This form of construction, whereby constructor
|
900 | 910 | arguments for \tcode{first} and \tcode{second} are each provided in a separate
|
901 | 911 | \tcode{tuple} object, is called \defn{piecewise construction}.
|
| 912 | +\begin{note} |
| 913 | +If a data member of \tcode{pair} is of reference type and |
| 914 | +its initialization binds it to a temporary object, |
| 915 | +the program is ill-formed\iref{class.base.init}. |
| 916 | +\end{note} |
902 | 917 | \end{itemdescr}
|
903 | 918 |
|
904 | 919 | \indexlibrarymember{operator=}{pair}%
|
|
1694 | 1709 | \begin{codeblock}
|
1695 | 1710 | !conjunction_v<is_convertible<UTypes, Types>...>
|
1696 | 1711 | \end{codeblock}
|
| 1712 | +This constructor is defined as deleted if |
| 1713 | +\begin{codeblock} |
| 1714 | +(reference_constructs_from_temporary_v<Types, UTypes\&\&> || ...) |
| 1715 | +\end{codeblock} |
| 1716 | +is \tcode{true}. |
1697 | 1717 | \end{itemdescr}
|
1698 | 1718 |
|
1699 | 1719 | \indexlibraryctor{tuple}%
|
|
1769 | 1789 | \begin{codeblock}
|
1770 | 1790 | !(is_convertible_v<decltype(get<I>(@\exposid{FWD}@(u))), Types> && ...)
|
1771 | 1791 | \end{codeblock}
|
| 1792 | +The constructor is defined as deleted if |
| 1793 | +\begin{codeblock} |
| 1794 | +(reference_constructs_from_temporary_v<Types, decltype(get<I>(@\exposid{FWD}@(u)))> || ...) |
| 1795 | +\end{codeblock} |
| 1796 | +is \tcode{true}. |
1772 | 1797 | \end{itemdescr}
|
1773 | 1798 |
|
1774 | 1799 | \indexlibraryctor{tuple}%
|
|
1806 | 1831 | !is_convertible_v<decltype(get<0>(@\exposid{FWD}@(u))), @$\tcode{T}_0$@> ||
|
1807 | 1832 | !is_convertible_v<decltype(get<1>(@\exposid{FWD}@(u))), @$\tcode{T}_1$@>
|
1808 | 1833 | \end{codeblock}
|
| 1834 | +The constructor is defined as deleted if |
| 1835 | +\begin{codeblock} |
| 1836 | +reference_constructs_from_temporary_v<@$\tcode{T}_0$@, decltype(get<0>(@\exposid{FWD}@(u)))> || |
| 1837 | +reference_constructs_from_temporary_v<@$\tcode{T}_1$@, decltype(get<1>(@\exposid{FWD}@(u)))> |
| 1838 | +\end{codeblock} |
| 1839 | +is \tcode{true}. |
1809 | 1840 | \end{itemdescr}
|
1810 | 1841 |
|
1811 | 1842 | \indexlibraryctor{tuple}%
|
|
2367 | 2398 | \end{itemdecl}
|
2368 | 2399 |
|
2369 | 2400 | \begin{itemdescr}
|
| 2401 | +\pnum |
| 2402 | +\mandates |
| 2403 | +If \tcode{tuple_size_v<remove_reference_t<Tuple>>} is 1, |
| 2404 | +then |
| 2405 | +\tcode{reference_constructs_from_temporary_v<T, decltype(get<0>(declval<Tuple>()))>} |
| 2406 | +is \tcode{false}. |
| 2407 | + |
2370 | 2408 | \pnum
|
2371 | 2409 | \effects
|
2372 | 2410 | Given the exposition-only function:
|
|
14266 | 14304 | if \tcode{R} is \cv{}~\keyword{void}, otherwise
|
14267 | 14305 | \tcode{\placeholdernc{INVOKE}(f, t$_1$, t$_2$, $\dotsc$, t$_N$)} implicitly converted
|
14268 | 14306 | to \tcode{R}.
|
| 14307 | +If |
| 14308 | +\tcode{reference_converts_from_temporary_v<R, decltype(\placeholdernc{INVOKE}(f, t$_1$, t$_2$, $\dotsc$, t$_N$)} |
| 14309 | +is true, |
| 14310 | +\tcode{\placeholdernc{INVOKE}<R>(f, t$_1$, t$_2$, $\dotsc$, t$_N$)} |
| 14311 | +is ill-formed. |
14269 | 14312 |
|
14270 | 14313 | \pnum
|
14271 | 14314 | \indextext{call wrapper}%
|
|
17427 | 17470 |
|
17428 | 17471 | template<class T> struct has_unique_object_representations;
|
17429 | 17472 |
|
| 17473 | + template<class T, class U> struct reference_constructs_from_temporary; |
| 17474 | + template<class T, class U> struct reference_converts_from_temporary; |
| 17475 | + |
17430 | 17476 | // \ref{meta.unary.prop.query}, type property queries
|
17431 | 17477 | template<class T> struct alignment_of;
|
17432 | 17478 | template<class T> struct rank;
|
|
17706 | 17752 | template<class T>
|
17707 | 17753 | inline constexpr bool has_unique_object_representations_v
|
17708 | 17754 | = has_unique_object_representations<T>::value;
|
| 17755 | + template<class T, class U> |
| 17756 | + inline constexpr bool @\libglobal{reference_constructs_from_temporary_v}@ = |
| 17757 | + reference_constructs_from_temporary<T, U>::value; |
| 17758 | + template<class T, class U> |
| 17759 | + inline constexpr bool @\libglobal{reference_converts_from_temporary_v}@ = |
| 17760 | + reference_converts_from_temporary<T, U>::value; |
17709 | 17761 |
|
17710 | 17762 | // \ref{meta.unary.prop.query}, type property queries
|
17711 | 17763 | template<class T>
|
|
17961 | 18013 | in the context of the corresponding definition
|
17962 | 18014 | notwithstanding the restrictions of~\ref{declval}.
|
17963 | 18015 |
|
| 18016 | +\pnum |
| 18017 | +For the purpose of defining the templates in this subclause, |
| 18018 | +let \tcode{\placeholder{VAL}<T>} for some type \tcode{T} be |
| 18019 | +an expression defined as follows: |
| 18020 | +\begin{itemize} |
| 18021 | +\item |
| 18022 | +If \tcode{T} is a reference or function type, |
| 18023 | +\tcode{\placeholder{VAL}<T>} is an expression |
| 18024 | +with the same type and value category as \tcode{declval<T>()}. |
| 18025 | +\item |
| 18026 | +Otherwise, \tcode{\placeholder{VAL}<T>} is a prvalue |
| 18027 | +that initially has type \tcode{T}. |
| 18028 | +\begin{note} |
| 18029 | +If \tcode{T} is cv-qualified, |
| 18030 | +the cv-qualification is subject to adjustment\iref{expr.type}. |
| 18031 | +\end{note} |
| 18032 | +\end{itemize} |
| 18033 | + |
17964 | 18034 | \begin{libreqtab3b}{Type property predicates}{meta.unary.prop}
|
17965 | 18035 | \\ \topline
|
17966 | 18036 | \lhdr{Template} & \chdr{Condition} & \rhdr{Preconditions} \\ \capsep
|
|
0 commit comments