std::swap(std::variant)
STD::交换%28 std::变体%29
Defined in header | | |
---|---|---|
template <class... Types> void swap(variant<Types...>& lhs, variant<Types...>& rhs) noexcept(/* see below */ | | (since C++17) |
重载std::swap
算法std::variant
.有效地打电话lhs.swap(rhs)
...
此重载只参与在下列情况下的重载解决方案:is_move_constructible_v<T_i>和is_swappable_v<T_i>对所有人都是正确的T_i在Types...
参数
lhs, rhs | - | variant objects whose values to swap |
---|
返回值
%280%29
例外
noexcept
规格:
noexcept(noexcept(lhs.swap(rhs)))
例
另见
swap | swaps with another variant (public member function) |
---|
© cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。