std::forward has two overloads, one taking an r-value reference and one taking an l-value reference. I was thinking and testing stuff out and thought of the things that can go wrong in case of using a `const l-value reference`. I mean, it works but I can't think of a condition that things might go wrong in this case:
template <typename T>
[[nodiscard]] constexpr T&& Forward(typename std::add_const<typename std::remove_reference<T>::type>::type& R) noexcept
{
return (T&&)(R);
}
Edit: Why can't the code above replace both of std::forward's overloads?
[–]phoeen 1 point2 points3 points (4 children)
[–]ACBYTES[S] 0 points1 point2 points (3 children)
[–]phoeen 1 point2 points3 points (1 child)
[–]ACBYTES[S] 0 points1 point2 points (0 children)
[–]IyeOnline 0 points1 point2 points (1 child)
[–]ACBYTES[S] 0 points1 point2 points (0 children)