Last active
August 29, 2015 14:23
-
-
Save Veedrac/6abe18505d4ed174983b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cpp.cpp:44:18: error: non-const lvalue reference to type 'X' cannot bind to a temporary of type | |
'typename std::remove_reference<X &>::type' (aka 'X') | |
swap(std::move(other)); | |
^~~~~~~~~~~~~~~~ | |
cpp.cpp:8:22: note: passing argument to parameter 'other' here | |
void swap(X& other) noexcept | |
^ | |
cpp.cpp:65:18: error: non-const lvalue reference to type 'X' cannot bind to a temporary of type | |
'typename std::remove_reference<X &>::type' (aka 'X') | |
swap(std::move(rhs)); | |
^~~~~~~~~~~~~~ | |
cpp.cpp:8:22: note: passing argument to parameter 'other' here | |
void swap(X& other) noexcept | |
^ | |
2 errors generated. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cpp.cpp: In constructor ‘X::X(X&&)’: | |
cpp.cpp:44:27: error: invalid initialization of non-const reference of type ‘X&’ from an rvalue of type ‘std::remove_reference<X&>::type {aka X}’ | |
swap(std::move(other)); | |
^ | |
cpp.cpp:8:14: note: initializing argument 1 of ‘void X::swap(X&)’ | |
void swap(X& other) noexcept | |
^ | |
cpp.cpp: In member function ‘X& X::operator=(X&&)’: | |
cpp.cpp:65:27: error: invalid initialization of non-const reference of type ‘X&’ from an rvalue of type ‘std::remove_reference<X&>::type {aka X}’ | |
swap(std::move(rhs)); | |
^ | |
cpp.cpp:8:14: note: initializing argument 1 of ‘void X::swap(X&)’ | |
void swap(X& other) noexcept | |
^ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment