首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

MoveAssignable

指定可以从r值争论。

所需

类型T满足MoveAssignable如果。

给予。

  • t,可修改的lvalue表达式类型T
  • rv,一个r值类型表达式T

下列表达式必须有效并具有指定的效果。

Expression

Return type

Return value

Post-conditions

t = rv

T&

t

If t and rv do not refer to the same object, the value of t is equivalent to the value of rv before the assignment. The new value of rv is unspecified.

注记

类型不必实现移动赋值算子为了满足这种类型的要求:复制赋值算子,它以值或作为const Type&,将绑定到rvalue参数。

如果MoveAssignable类实现了移动赋值操作符,它也可以实现移动语义利用以下事实rv未指定任务后。

另见

is_move_assignableis_trivially_move_assignableis_nothrow_move_assignable (C++11)(C++11)(C++11)

checks if a type has a move assignment operator (class template)

代码语言:txt
复制
 ? cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com