右值绑定到非const引用

iamnobody iamnobody 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
c++ 2003

13.3.1.5

During overload resolution, the implied object argument is indistinguishable from other arguments. The
implicit object parameter, however, retains its identity since conversions on the corresponding argument
shall obey these additional rules:
— no temporary object can be introduced to hold the argument for the implicit object parameter;
— no user-defined conversions can be applied to achieve a type match with it; and
— even if the implicit object parameter is not const-qualified, an rvalue temporary can be bound to the
parameter as long as in all other respects the temporary can be converted to the type of the implicit
object parameter.


最后一点说的是右值可以绑定到非const引用是什么情况?
求举例说明.
...全文

相关推荐

评论 6
收藏 已收藏
分享
返回顶部
iamnobody
C++ 语言 65,214 成员 250,514 内容