From 18e6de7d6ba75326262918d4bd0dde93e5c6fa0a Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Thu, 10 Sep 2020 15:04:43 +0200 Subject: [PATCH] added compile time check --- container/FixedMap.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/container/FixedMap.h b/container/FixedMap.h index 3da65784..3b09fa3b 100644 --- a/container/FixedMap.h +++ b/container/FixedMap.h @@ -14,6 +14,10 @@ */ template class FixedMap: public SerializeIF { + static_assert (std::is_trivially_copyable::value or + std::is_base_of::value, + "Types used in FixedMap must either be trivial copy-able or a " + "derived class from SerializeIF to be serialize-able"); public: static const uint8_t INTERFACE_ID = CLASS_ID::FIXED_MAP; static const ReturnValue_t KEY_ALREADY_EXISTS = MAKE_RETURN_CODE(0x01);