|
2224 | 2224 |
|
2225 | 2225 | // \ref{optional.assign}, assignment
|
2226 | 2226 | optional& operator=(nullopt_t) noexcept;
|
2227 |
| - optional& operator=(const optional&); |
2228 |
| - optional& operator=(optional&&) noexcept(@\seebelow@); |
| 2227 | + constexpr optional& operator=(const optional&); |
| 2228 | + constexpr optional& operator=(optional&&) noexcept(@\seebelow@); |
2229 | 2229 | template<class U = T> optional& operator=(U&&);
|
2230 | 2230 | template<class U> optional& operator=(const optional<U>&);
|
2231 | 2231 | template<class U> optional& operator=(optional<U>&&);
|
|
2325 | 2325 | This constructor shall be defined as deleted unless
|
2326 | 2326 | \tcode{is_copy_constructible_v<T>} is \tcode{true}.
|
2327 | 2327 | If \tcode{is_trivially_copy_constructible_v<T>} is \tcode{true},
|
2328 |
| -this constructor shall be a \tcode{constexpr} constructor. |
| 2328 | +this constructor is trivial.. |
2329 | 2329 | \end{itemdescr}
|
2330 | 2330 |
|
2331 | 2331 | \indexlibrary{\idxcode{optional}!constructor}%
|
|
2355 | 2355 | This constructor shall not participate in overload resolution
|
2356 | 2356 | unless \tcode{is_move_constructible_v<T>} is \tcode{true}.
|
2357 | 2357 | If \tcode{is_trivially_move_constructible_v<T>} is \tcode{true},
|
2358 |
| -this constructor shall be a \tcode{constexpr} constructor. |
| 2358 | +this constructor is trivial. |
2359 | 2359 | \end{itemdescr}
|
2360 | 2360 |
|
2361 | 2361 | \indexlibrary{\idxcode{optional}!constructor}%
|
|
2565 | 2565 |
|
2566 | 2566 | \indexlibrarymember{operator=}{optional}%
|
2567 | 2567 | \begin{itemdecl}
|
2568 |
| -optional<T>& operator=(const optional& rhs); |
| 2568 | +constexpr optional<T>& operator=(const optional& rhs); |
2569 | 2569 | \end{itemdecl}
|
2570 | 2570 |
|
2571 | 2571 | \begin{itemdescr}
|
|
2603 | 2603 | This operator shall be defined as deleted unless
|
2604 | 2604 | \tcode{is_copy_constructible_v<T>} is \tcode{true} and
|
2605 | 2605 | \tcode{is_copy_assignable_v<T>} is \tcode{true}.
|
| 2606 | +If \tcode{is_trivially_copy_constructible_v<T> \&\&} |
| 2607 | +\tcode{is_trivially_copy_assignable_v<T> \&\&} |
| 2608 | +\tcode{is_trivially_destructible_v<T>} is \tcode{true}, |
| 2609 | +this assignment operator is trivial. |
2606 | 2610 | \end{itemdescr}
|
2607 | 2611 |
|
2608 | 2612 | \indexlibrarymember{operator=}{optional}%
|
2609 | 2613 | \begin{itemdecl}
|
2610 |
| -optional<T>& operator=(optional&& rhs) noexcept(@\seebelow@); |
| 2614 | +constexpr optional<T>& operator=(optional&& rhs) noexcept(@\seebelow@); |
2611 | 2615 | \end{itemdecl}
|
2612 | 2616 |
|
2613 | 2617 | \begin{itemdescr}
|
|
2653 | 2657 | This operator shall not participate in overload resolution unless
|
2654 | 2658 | \tcode{is_move_constructible_v<T>} is \tcode{true} and
|
2655 | 2659 | \tcode{is_move_assignable_v<T>} is \tcode{true}.
|
| 2660 | +If \tcode{is_trivially_move_constructible_v<T> \&\&} |
| 2661 | +\tcode{is_trivially_move_assignable_v<T> \&\&} |
| 2662 | +\tcode{is_trivially_destructible_v<T>} is \tcode{true}, |
| 2663 | +this assignment operator is trivial. |
2656 | 2664 | \end{itemdescr}
|
2657 | 2665 |
|
2658 | 2666 | \indexlibrarymember{operator=}{optional}%
|
|
3803 | 3811 | public:
|
3804 | 3812 | // \ref{variant.ctor}, constructors
|
3805 | 3813 | constexpr variant() noexcept(@\seebelow@);
|
3806 |
| - variant(const variant&); |
3807 |
| - variant(variant&&) noexcept(@\seebelow@); |
| 3814 | + constexpr variant(const variant&); |
| 3815 | + constexpr variant(variant&&) noexcept(@\seebelow@); |
3808 | 3816 |
|
3809 | 3817 | template<class T>
|
3810 | 3818 | constexpr variant(T&&) noexcept(@\seebelow@);
|
|
3823 | 3831 | ~variant();
|
3824 | 3832 |
|
3825 | 3833 | // \ref{variant.assign}, assignment
|
3826 |
| - variant& operator=(const variant&); |
3827 |
| - variant& operator=(variant&&) noexcept(@\seebelow@); |
| 3834 | + constexpr variant& operator=(const variant&); |
| 3835 | + constexpr variant& operator=(variant&&) noexcept(@\seebelow@); |
3828 | 3836 |
|
3829 | 3837 | template<class T> variant& operator=(T&&) noexcept(@\seebelow@);
|
3830 | 3838 |
|
|
3908 | 3916 |
|
3909 | 3917 | \indexlibrary{\idxcode{variant}!constructor}%
|
3910 | 3918 | \begin{itemdecl}
|
3911 |
| -variant(const variant& w); |
| 3919 | +constexpr variant(const variant& w); |
3912 | 3920 | \end{itemdecl}
|
3913 | 3921 |
|
3914 | 3922 | \begin{itemdescr}
|
|
3927 | 3935 | \remarks
|
3928 | 3936 | This constructor shall be defined as deleted unless
|
3929 | 3937 | \tcode{is_copy_constructible_v<$\tcode{T}_i$>} is \tcode{true} for all $i$.
|
| 3938 | +If \tcode{is_trivially_copy_constructible_v<$\tcode{T}_i$>} |
| 3939 | +is \tcode{true} for all $i$, this constructor is trivial. |
3930 | 3940 | \end{itemdescr}
|
3931 | 3941 |
|
3932 | 3942 | \indexlibrary{\idxcode{variant}!constructor}%
|
3933 | 3943 | \begin{itemdecl}
|
3934 |
| -variant(variant&& w) noexcept(@\seebelow@); |
| 3944 | +constexpr variant(variant&& w) noexcept(@\seebelow@); |
3935 | 3945 | \end{itemdecl}
|
3936 | 3946 |
|
3937 | 3947 | \begin{itemdescr}
|
|
3952 | 3962 | \tcode{is_nothrow_move_constructible_v<$\tcode{T}_i$>} for all $i$.
|
3953 | 3963 | This function shall not participate in overload resolution unless
|
3954 | 3964 | \tcode{is_move_constructible_v<$\tcode{T}_i$>} is \tcode{true} for all $i$.
|
| 3965 | +If \tcode{is_trivially_move_constructible_v<$\tcode{T}_i$>} |
| 3966 | +is \tcode{true} for all $i$, this constructor is trivial. |
3955 | 3967 | \end{itemdescr}
|
3956 | 3968 |
|
3957 | 3969 | \indexlibrary{\idxcode{variant}!constructor}%
|
|
4165 | 4177 |
|
4166 | 4178 | \indexlibrarymember{operator=}{variant}%
|
4167 | 4179 | \begin{itemdecl}
|
4168 |
| -variant& operator=(const variant& rhs); |
| 4180 | +constexpr variant& operator=(const variant& rhs); |
4169 | 4181 | \end{itemdecl}
|
4170 | 4182 |
|
4171 | 4183 | \begin{itemdescr}
|
|
4204 | 4216 | \tcode{is_copy_constructible_v<$\tcode{T}_i$> \&\&}
|
4205 | 4217 | \tcode{is_copy_assignable_v<$\tcode{T}_i$>}
|
4206 | 4218 | is \tcode{true} for all $i$.
|
| 4219 | +If \tcode{is_trivially_copy_constructible_v<$\tcode{T}_i$> \&\&} |
| 4220 | +\tcode{is_trivially_copy_assignable_v<$\tcode{T}_i$> \&\&} |
| 4221 | +\tcode{is_trivially_destructible_v<$\tcode{T}_i$>} |
| 4222 | +is true for all $i$, this assignment operator is trivial. |
4207 | 4223 | \end{itemdescr}
|
4208 | 4224 |
|
4209 | 4225 | \indexlibrarymember{operator=}{variant}%
|
4210 | 4226 | \begin{itemdecl}
|
4211 |
| -variant& operator=(variant&& rhs) noexcept(@\seebelow@); |
| 4227 | +constexpr variant& operator=(variant&& rhs) noexcept(@\seebelow@); |
4212 | 4228 | \end{itemdecl}
|
4213 | 4229 |
|
4214 | 4230 | \begin{itemdescr}
|
|
4236 | 4252 | \pnum
|
4237 | 4253 | \remarks
|
4238 | 4254 | This function shall not participate in overload resolution unless
|
4239 |
| -\tcode{is_move_constructible_v<$\tcode{T}_i$> \&\& is_move_assignable_v<$\tcode{T}_i$>} is |
| 4255 | +\tcode{is_move_constructible_v<$\tcode{T}_i$> \&\&} |
| 4256 | +\tcode{is_move_assignable_v<$\tcode{T}_i$>} is |
4240 | 4257 | \tcode{true} for all $i$.
|
| 4258 | +If \tcode{is_trivially_move_constructible_v<$\tcode{T}_i$> \&\&} |
| 4259 | +\tcode{is_trivially_move_assignable_v<$\tcode{T}_i$> \&\&} |
| 4260 | +\tcode{is_trivially_destructible_v<$\tcode{T}_i$>} |
| 4261 | +is true for all $i$, this assignment operator is trivial. |
4241 | 4262 | The expression inside \tcode{noexcept} is equivalent to:
|
4242 | 4263 | \tcode{is_nothrow_move_constructible_v<$\tcode{T}_i$> \&\& is_nothrow_move_assignable_v<$\tcode{T}_i$>} for all $i$.
|
4243 | 4264 | \begin{itemize}
|
|
0 commit comments