Movatterモバイル変換


[0]ホーム

URL:


This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 119a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2025-12-20


1066. When is a copy/move assignment operator implicitly defined?

Section:11.4.6  [class.copy.assign]    Status:C++11    Submitter:Mike Miller    Date:2010-03-24

[Voted into the WP at the November, 2010 meeting.]

N3092 comment US 64

According to 11.4.5.3 [class.copy.ctor] paragraph 28,

A copy/move assignment operator that is defaulted and not definedas deleted isimplicitly defined when an object of itsclass type is assigned a value of its class type or a value of aclass type derived from its class type or when it is explicitlydefaulted after its first declaration.

This sounds as if any assignment to a class object, regardlessof whether it is a copy or a move assignment, defines both thecopy and move operators. Presumably an assignment should onlydefine the assignment operator chosen by overload resolution forthe operation. (Compare the corresponding wording in paragraph 14for the copy/move constructors: “...implicitly definedif it is used to initialize an object of its class type...”)

Proposed resolution (August, 2010):

This issue is resolved by the resolution ofissue 1051.




[8]ページ先頭

©2009-2026 Movatter.jp