diff --git a/src/core/hle/service/hle_ipc.h b/src/core/hle/service/hle_ipc.h index 8eeecd38e9..b1c7daa91e 100644 --- a/src/core/hle/service/hle_ipc.h +++ b/src/core/hle/service/hle_ipc.h @@ -292,18 +292,20 @@ public: * @param data The container/data to write into a buffer. * @param buffer_index The buffer in particular to write to. */ - template >> + template + requires !std::is_pointer_v + && std::contiguous_iterator std::size_t WriteBuffer(const T& data, std::size_t buffer_index = 0) const { - if constexpr (std::contiguous_iterator) { - using ContiguousType = typename T::value_type; - static_assert(std::is_trivially_copyable_v, - "Container to WriteBuffer must contain trivially copyable objects"); - return WriteBuffer(std::data(data), std::size(data) * sizeof(ContiguousType), - buffer_index); - } else { - static_assert(std::is_trivially_copyable_v, "T must be trivially copyable"); - return WriteBuffer(&data, sizeof(T), buffer_index); - } + using C = typename T::value_type; + static_assert(std::is_trivially_copyable_v, "Container to WriteBuffer must contain trivially copyable objects"); + return WriteBuffer(std::data(data), std::size(data) * sizeof(C), buffer_index); + } + template + requires !std::is_pointer_v + && !std::contiguous_iterator + std::size_t WriteBuffer(const T& data, std::size_t buffer_index = 0) const { + static_assert(std::is_trivially_copyable_v, "T must be trivially copyable"); + return WriteBuffer(&data, sizeof(T), buffer_index); } /// Helper function to get the size of the input buffer