mirror of
https://github.com/ARMSX2/ARMSX3.git
synced 2026-08-24 16:58:52 -07:00
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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user