I tried implementing std::move, which uses std::remove_reference, however it seems to work without it. Please, give me an example in which my implementation will fails whithout std::remove_reference.
template <class type> type && move(type & source) { return (type &&) source; }
template <class type> type && move(type && source) { return (type &&) source; }
Run Code Online (Sandbox Code Playgroud)
Is std::remove_reference used only to avoid overloading std::move?
Here is a test class to help you:
class test {
public : …Run Code Online (Sandbox Code Playgroud)