// SPDX-License-Identifier: MPL-2.0 // Copyright © 2021 Skyline Team and Contributors (https://github.com/skyline-emu/) #pragma once #include namespace Common { /** * @brief A temporary shim for C++ 20's bit_cast to make transitioning to it easier */ template requires (sizeof(To) == sizeof(From) && std::is_trivially_copyable_v && std::is_trivially_copyable_v) To BitCast(const From &from) { return *reinterpret_cast(&from); } }