Hacker News new | ask | show | jobs
by codeflo 2448 days ago
std::move's implementation not quite as elegant, though (this is from the GCC source):

  template<typename _Tp>
    constexpr typename std::remove_reference<_Tp>::type&&
    move(_Tp&& __t) noexcept
    { return static_cast<typename std::remove_reference<_Tp>::type&&>(__t); }
1 comments

It’s a bit ugly because the standard library functions are replete with underscores, and of course it isn’t empty. But I still think it’s quite surprising, as most people would think it actually does some sort of semantic “move”.
> It’s a bit ugly because the standard library functions are replete with underscores, and of course it isn’t empty.

I'll be honest, neither of those are my top issue with that in terms of why I think it's ugly.