mirror of https://github.com/RPCS3/rpcs3
Fix possible ambiguity of utils::bless (#17757)
Make utils::bless at util/bless.hpp argument type be complete, avoiding possible ambiguity with RSX-utility version. A fix for Apple Clang compiler.
This commit is contained in:
parent
a442cb91a1
commit
d9f913016c
|
|
@ -1,10 +1,12 @@
|
|||
#pragma once
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
namespace utils
|
||||
{
|
||||
// Hack. Pointer cast util to workaround UB. Use with extreme care.
|
||||
template <typename T, typename U>
|
||||
[[nodiscard]] T* bless(U* ptr)
|
||||
template <typename T, typename U> requires (std::is_pointer_v<std::remove_reference_t<U>>)
|
||||
[[nodiscard]] inline T* bless(const U& ptr)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
return (T*)ptr;
|
||||
|
|
@ -21,3 +23,4 @@ namespace utils
|
|||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue