Fixup ::as_rvalue

This commit is contained in:
Eladash 2020-04-11 22:52:42 +03:00 committed by Ivan
parent 141d62fbf9
commit 8e61c65c0d
2 changed files with 3 additions and 15 deletions

View File

@ -168,21 +168,9 @@ template <std::size_t N>
using get_sint_t = typename get_int_impl<N>::stype;
template <typename T>
T as_rvalue(T&& obj)
std::remove_reference_t<T> as_rvalue(T&& obj)
{
return obj;
}
template <typename T>
T as_rvalue(const T& obj)
{
return obj;
}
template <typename T>
T as_rvalue(const volatile T& obj)
{
return obj;
return std::forward<T>(obj);
}
// Formatting helper, type-specific preprocessing for improving safety and functionality

View File

@ -881,7 +881,7 @@ spu_function_t spu_recompiler::compile(spu_program&& _func)
for (u32 d : words)
c->dd(d);
for (auto&& work : decltype(consts)(std::move(consts)))
for (auto&& work : ::as_rvalue(std::move(consts)))
{
work();
}