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:
Elad 2025-11-27 02:50:45 +02:00 committed by GitHub
parent a442cb91a1
commit d9f913016c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 2 deletions

View File

@ -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
}
}