From f7df03e328baf4d7587ce51c083e6d14a229244f Mon Sep 17 00:00:00 2001 From: David Marcec Date: Mon, 3 Aug 2020 19:30:39 +1000 Subject: [PATCH] Move to common namespace --- src/common/concepts.h | 4 ++++ src/core/hle/kernel/hle_ipc.h | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/common/concepts.h b/src/common/concepts.h index b804077148..6def398cde 100644 --- a/src/common/concepts.h +++ b/src/common/concepts.h @@ -4,6 +4,8 @@ #pragma once +namespace Common { + // Check if type is like an STL container template concept IsSTLContainer = requires(T t) { @@ -18,3 +20,5 @@ concept IsSTLContainer = requires(T t) { t.data(); t.size(); }; + +} // namespace Common diff --git a/src/core/hle/kernel/hle_ipc.h b/src/core/hle/kernel/hle_ipc.h index 9d4927c58c..f3277b766e 100644 --- a/src/core/hle/kernel/hle_ipc.h +++ b/src/core/hle/kernel/hle_ipc.h @@ -194,15 +194,15 @@ public: /* Helper function to write a buffer using the appropriate buffer descriptor * - * @tparam ContiguousContainer an arbitrary container that satisfies the - * ContiguousContainer concept in the C++ standard library. + * @tparam T an arbitrary container that satisfies the + * ContiguousContainer concept in the C++ standard library or a trivially copyable type. * - * @param container The container to write the data of into a buffer. + * @param data The container/data to write into a buffer. * @param buffer_index The buffer in particular to write to. */ template >> std::size_t WriteBuffer(const T& data, std::size_t buffer_index = 0) const { - if constexpr (IsSTLContainer) { + if constexpr (Common::IsSTLContainer) { using ContiguousType = typename T::value_type; static_assert(std::is_trivially_copyable_v, "Container to WriteBuffer must contain trivially copyable objects");