You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this case, the program is not going to invoke the move constructor, but rather, the copy constructor. Changing the function call to process(explicit{std::move(e)}) is going to move e.
Obviously, if the copy constructor is deleted, then this is not an issue as the code is just going to fail to compile. Let me know if this check can be added so I can open a pull request for it.
Thanks in advance.
The text was updated successfully, but these errors were encountered:
In this case, the program is not going to invoke the move constructor, but rather, the copy constructor. Changing the function call to process(explicit{std::move(e)}) is going to move e.
Obviously, if the copy constructor is deleted, then this is not an issue as the code is just going to fail to compile. Let me know if this check can be added so I can open a pull request for it.
When making a move constructor
explicit
, code may end up invoking the class' copy constructor instead. For ExampleIn this case, the program is not going to invoke the move constructor, but rather, the copy constructor. Changing the function call to
process(explicit{std::move(e)})
is going to movee
.Obviously, if the copy constructor is deleted, then this is not an issue as the code is just going to fail to compile. Let me know if this check can be added so I can open a pull request for it.
Thanks in advance.
The text was updated successfully, but these errors were encountered: