From 5154a87f1d7861c2e0ac01ecc552603ceedad55b Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 27 Aug 2021 20:52:15 +0100 Subject: Prevent reading of non-trivial types from RawDataReader --- lib/rawDataReader.h | 1 + 1 file changed, 1 insertion(+) (limited to 'lib') diff --git a/lib/rawDataReader.h b/lib/rawDataReader.h index b23de88..c3a537a 100644 --- a/lib/rawDataReader.h +++ b/lib/rawDataReader.h @@ -36,6 +36,7 @@ namespace MyGrate { typename type_map::target readValue(size_t L) { + static_assert(std::is_trivial_v, "Do not read non-trivial types"); verify(L > 0 && L <= sizeof(T), "Read exceeds target size"); offsetSizeCheck(L); T v {}; -- cgit v1.2.3