|
16776 | 16776 | \item If \tcode{sizeof...(T)} is one, let \tcode{T0} denote the sole type |
16777 | 16777 | constituting the pack \tcode{T}. |
16778 | 16778 | The member \grammarterm{typedef-name} \tcode{type} shall denote the same |
16779 | | -type as \tcode{decay_t<T0>}. |
| 16779 | +type, if any, as \tcode{common_type_t<T0, T0>}; |
| 16780 | +otherwise there shall be no member \tcode{type}. |
16780 | 16781 |
|
16781 | 16782 | \item If \tcode{sizeof...(T)} is two, |
16782 | 16783 | let the first and second types constituting \tcode{T} be denoted |
|
16798 | 16799 | In either case, the member \grammarterm{typedef-name} \tcode{type} shall denote |
16799 | 16800 | the same type, if any, as \tcode{C}. |
16800 | 16801 | Otherwise, there shall be no member \tcode{type}. |
16801 | | -\begin{note} |
16802 | | -When \tcode{is_same_v<T1, T2>} is \tcode{true}, |
16803 | | -the effect is equivalent to that of \tcode{common_type<T1>}. |
16804 | | -\end{note} |
16805 | 16802 |
|
16806 | 16803 | \item If \tcode{sizeof...(T)} is greater than two, |
16807 | 16804 | let \tcode{T1}, \tcode{T2}, and \tcode{R}, respectively, |
|
16816 | 16813 | Note B: Notwithstanding the provisions of \ref{meta.type.synop}, and |
16817 | 16814 | pursuant to \ref{namespace.std}, |
16818 | 16815 | a program may specialize \tcode{common_type<T1, T2>} |
16819 | | -for distinct types \tcode{T1} and \tcode{T2} such that |
| 16816 | +for types \tcode{T1} and \tcode{T2} such that |
16820 | 16817 | \tcode{is_same_v<T1, decay_t<T1>>} and |
16821 | 16818 | \tcode{is_same_v<T2, decay_t<T2>>} are each \tcode{true}. |
16822 | 16819 | \begin{note} |
|
17629 | 17626 | class duration { |
17630 | 17627 | public: |
17631 | 17628 | using rep = Rep; |
17632 | | - using period = Period; |
| 17629 | + using period = typename Period::type; |
17633 | 17630 | private: |
17634 | 17631 | rep rep_; // \expos |
17635 | 17632 | public: |
|
17647 | 17644 | constexpr rep count() const; |
17648 | 17645 |
|
17649 | 17646 | // \ref{time.duration.arithmetic}, arithmetic |
17650 | | - constexpr duration operator+() const; |
17651 | | - constexpr duration operator-() const; |
| 17647 | + constexpr common_type_t<duration> operator+() const; |
| 17648 | + constexpr common_type_t<duration> operator-() const; |
17652 | 17649 | constexpr duration& operator++(); |
17653 | 17650 | constexpr duration operator++(int); |
17654 | 17651 | constexpr duration& operator--(); |
@@ -17774,22 +17771,22 @@ |
17774 | 17771 |
|
17775 | 17772 | \indexlibrarymember{operator+}{duration}% |
17776 | 17773 | \begin{itemdecl} |
17777 | | -constexpr duration operator+() const; |
| 17774 | +constexpr common_type_t<duration> operator+() const; |
17778 | 17775 | \end{itemdecl} |
17779 | 17776 |
|
17780 | 17777 | \begin{itemdescr} |
17781 | 17778 | \pnum |
17782 | | -\returns \tcode{*this}. |
| 17779 | +\returns \tcode{common_type_t<duration>(*this)}. |
17783 | 17780 | \end{itemdescr} |
17784 | 17781 |
|
17785 | 17782 | \indexlibrarymember{operator-}{duration}% |
17786 | 17783 | \begin{itemdecl} |
17787 | | -constexpr duration operator-() const; |
| 17784 | +constexpr common_type_t<duration> operator-() const; |
17788 | 17785 | \end{itemdecl} |
17789 | 17786 |
|
17790 | 17787 | \begin{itemdescr} |
17791 | 17788 | \pnum |
17792 | | -\returns \tcode{duration(-rep_)}. |
| 17789 | +\returns \tcode{common_type_t<duration>(-rep_)}. |
17793 | 17790 | \end{itemdescr} |
17794 | 17791 |
|
17795 | 17792 | \indexlibrarymember{operator++}{duration}% |
|
0 commit comments