diff options
author | Liam <byteslice@airmail.cc> | 2024-01-30 08:18:48 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2024-02-02 15:32:10 +0100 |
commit | 78f72b3bf5aca16f8f3c5fd14c14eb0dae6e0604 (patch) | |
tree | 47bd02cd64efc22330d4907258b659ace76c1935 /src/core/hle/service/cmif_serialization.h | |
parent | Merge pull request #12857 from liamwhite/const (diff) | |
download | yuzu-78f72b3bf5aca16f8f3c5fd14c14eb0dae6e0604.tar yuzu-78f72b3bf5aca16f8f3c5fd14c14eb0dae6e0604.tar.gz yuzu-78f72b3bf5aca16f8f3c5fd14c14eb0dae6e0604.tar.bz2 yuzu-78f72b3bf5aca16f8f3c5fd14c14eb0dae6e0604.tar.lz yuzu-78f72b3bf5aca16f8f3c5fd14c14eb0dae6e0604.tar.xz yuzu-78f72b3bf5aca16f8f3c5fd14c14eb0dae6e0604.tar.zst yuzu-78f72b3bf5aca16f8f3c5fd14c14eb0dae6e0604.zip |
Diffstat (limited to 'src/core/hle/service/cmif_serialization.h')
-rw-r--r-- | src/core/hle/service/cmif_serialization.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/hle/service/cmif_serialization.h b/src/core/hle/service/cmif_serialization.h index 315475e71..e985fe317 100644 --- a/src/core/hle/service/cmif_serialization.h +++ b/src/core/hle/service/cmif_serialization.h @@ -115,6 +115,11 @@ struct ArgumentTraits { static constexpr ArgumentType Type = ArgumentType::InData; }; +template <typename... Ts> +consteval bool ConstIfReference() { + return ((!std::is_reference_v<Ts> || std::is_const_v<std::remove_reference_t<Ts>>) && ... && true); +} + struct RequestLayout { u32 copy_handle_count; u32 move_handle_count; @@ -435,6 +440,7 @@ void CmifReplyWrapImpl(HLERequestContext& ctx, T& t, Result (T::*f)(A...)) { } const bool is_domain = Domain ? ctx.GetManager()->IsDomain() : false; + static_assert(ConstIfReference<A...>(), "Arguments taken by reference must be const"); using MethodArguments = std::tuple<std::remove_cvref_t<A>...>; OutTemporaryBuffers buffers{}; |