When you delete a move constructor, it does not remove it from the set of functions found when searching by name. Whenever your code usually uses a move constructor, you get an error message because, although it was found, it was deleted.
You have two moves in the code. First, when you return a , because when copying is possible, and the object to be copied is denoted by lvalue ( a , here), it is treated as a move. The second is in assigning A b = f() , because a f() gives you a temporary one that is not yet bound to a link.
If you want the copy constructor to be found, and not the remote move constructor, you just have to get rid of your remote definition.
Joseph Mansfield Dec 29 '12 at 20:23 2012-12-29 20:23
source share