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
|
#pragma once
|
||||||
|
|
||||||
|
#include <type_traits>
|
||||||
|
|
||||||
namespace utils
|
namespace utils
|
||||||
{
|
{
|
||||||
// Hack. Pointer cast util to workaround UB. Use with extreme care.
|
// Hack. Pointer cast util to workaround UB. Use with extreme care.
|
||||||
template <typename T, typename U>
|
template <typename T, typename U> requires (std::is_pointer_v<std::remove_reference_t<U>>)
|
||||||
[[nodiscard]] T* bless(U* ptr)
|
[[nodiscard]] inline T* bless(const U& ptr)
|
||||||
{
|
{
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
return (T*)ptr;
|
return (T*)ptr;
|
||||||
@@ -21,3 +23,4 @@ namespace utils
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user