mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-01-03 23:30:16 +01:00
sigh, include type_traits
This commit is contained in:
parent
c9d57e8e80
commit
8f8315bccc
|
|
@ -1,9 +1,11 @@
|
|||
#pragma once
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
namespace utils
|
||||
{
|
||||
// Hack. Pointer cast util to workaround UB. Use with extreme care.
|
||||
template <typename T, typename U> requires requires () { +reinterpret_cast<T*>(static_cast<const U&>(nullptr)); }
|
||||
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
|
||||
|
|
@ -21,3 +23,4 @@ namespace utils
|
|||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue