|
1734 | 1734 | (see~\ref{dcl.init},
|
1735 | 1735 | \ref{over.match.conv}, and~\ref{over.match.ref})
|
1736 | 1736 | and the standard conversion sequence
|
1737 |
| -from the return type of $\tcode{F}_1$ to the destination type |
| 1737 | +from the result of $\tcode{F}_1$ to the destination type |
1738 | 1738 | (i.e., the type of the entity being initialized)
|
1739 | 1739 | is a better conversion sequence than the standard conversion sequence
|
1740 |
| -from the return type of $\tcode{F}_2$ to the destination type |
| 1740 | +from the result of $\tcode{F}_2$ to the destination type |
1741 | 1741 | \begin{example}
|
1742 | 1742 | \begin{codeblock}
|
1743 | 1743 | struct A {
|
|
2792 | 2792 | (where a standard conversion sequence that is a reference binding
|
2793 | 2793 | is considered to yield the cv-unqualified referenced type),
|
2794 | 2794 | where \tcode{T1} and \tcode{T2} are not the same type, and
|
2795 |
| -\tcode{const T2} is reference-compatible with \tcode{T1}\iref{dcl.init.ref}. |
| 2795 | +\tcode{const T2} is reference-compatible with \tcode{T1}\iref{dcl.init.ref} |
2796 | 2796 | \begin{example}
|
2797 | 2797 | \begin{codeblock}
|
2798 | 2798 | int f(const volatile int *);
|
|
2806 | 2806 | \end{codeblock}
|
2807 | 2807 | \end{example}
|
2808 | 2808 | or, if not that,
|
| 2809 | + |
2809 | 2810 | \item
|
2810 | 2811 | \tcode{S1}
|
2811 | 2812 | and
|
2812 | 2813 | \tcode{S2}
|
2813 | 2814 | bind ``reference to \tcode{T1}'' and ``reference to \tcode{T2}'',
|
2814 | 2815 | respectively\iref{dcl.init.ref},
|
2815 | 2816 | where \tcode{T1} and \tcode{T2} are not the same type, and
|
2816 |
| -\tcode{T2} is reference-compatible with \tcode{T1}. |
| 2817 | +\tcode{T2} is reference-compatible with \tcode{T1} |
2817 | 2818 | \begin{example}
|
2818 | 2819 | \begin{codeblock}
|
2819 | 2820 | int f(const int &);
|
|
2846 | 2847 | }
|
2847 | 2848 | \end{codeblock}
|
2848 | 2849 | \end{example}
|
| 2850 | +or, if not that, |
| 2851 | + |
| 2852 | +\item |
| 2853 | +\tcode{S1} and \tcode{S2} |
| 2854 | +bind the same reference type ``reference to \tcode{T}'' and |
| 2855 | +have source types \tcode{V1} and \tcode{V2}, respectively, |
| 2856 | +where the standard conversion sequence from \tcode{V1*} to \tcode{T*} |
| 2857 | +is better than the standard conversion sequence from \tcode{V2*} to \tcode{T*}. |
| 2858 | +\begin{example} |
| 2859 | +\begin{codeblock} |
| 2860 | +struct Z {}; |
| 2861 | + |
| 2862 | +struct A { |
| 2863 | + operator Z&(); |
| 2864 | + operator const Z&(); // \#1 |
| 2865 | +}; |
| 2866 | + |
| 2867 | +struct B { |
| 2868 | + operator Z(); |
| 2869 | + operator const Z&&(); // \#2 |
| 2870 | +}; |
| 2871 | + |
| 2872 | +const Z& r1 = A(); // OK, uses \#1 |
| 2873 | +const Z&& r2 = B(); // OK, uses \#2 |
| 2874 | +\end{codeblock} |
| 2875 | +\end{example} |
2849 | 2876 | \end{itemize}
|
2850 | 2877 |
|
2851 | 2878 | \item
|
|
0 commit comments