From 336405b85e88fdc46896437cb02fe52b46079369 Mon Sep 17 00:00:00 2001 From: Vernon Mauery Date: Mon, 8 Apr 2019 09:59:01 -0700 Subject: Add error message to build to make packing type errors clear Because the base template actually handles things (all integer types), it needs to ward off non-integer types in a clear way, rather than relying on the user seeing that a tuple doesn't have an operator <<(), for example. This provides a clear message if a specialized pack operation was not hit. Tested-by: attempted to build with a non-supported pack type Change-Id: I66280831e88b4eac903b89f523e5f1a56a53cf9d Signed-off-by: Vernon Mauery --- include/ipmid/message/pack.hpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/ipmid/message/pack.hpp b/include/ipmid/message/pack.hpp index b458af4..8a9abe1 100644 --- a/include/ipmid/message/pack.hpp +++ b/include/ipmid/message/pack.hpp @@ -75,6 +75,8 @@ struct PackSingle */ static int op(Payload& p, const T& t) { + static_assert(std::is_integral_v, + "Attempt to pack a type that has no IPMI pack operation"); // if not on a byte boundary, must pack values LSbit/LSByte first if (p.bitCount) { -- cgit v1.2.1