Category : c++11

I’m trying to understand more move semantic. Now this is a possible implementation of std::move: template <typename T> typename std::remove_reference<T>::type&& move_(T&& obj) { return static_cast<typename std::remove_reference<T>::type&&>(obj); } But I’ve edited it a bit to understand its workings: template <typename T> typename std::remove_reference<T>::type&& move_(T&& obj) { if(std::is_lvalue_reference<decltype(obj)>::value) return static_cast<typename std::remove_reference<T>::type&&>(obj); return obj; // dones’t work? // ..

Read more