From f730ae9814cbfc52e9c87a18f2cea18e72f07e2c Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Mon, 23 Feb 2015 18:23:18 +0200 Subject: [PATCH] sstring: add static_assert to prevent use on >1 byte types --- core/sstring.hh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/sstring.hh b/core/sstring.hh index ffa687d9b0..1826840a09 100644 --- a/core/sstring.hh +++ b/core/sstring.hh @@ -31,11 +31,17 @@ #include #include #include +#include #include #include "core/temporary_buffer.hh" template class basic_sstring { + static_assert( + (std::is_same::value + || std::is_same::value + || std::is_same::value), + "basic_sstring only supports single byte char types"); union contents { struct external_type { char_type* str;