From 46bebace20b3d6a3f1785a0881c23fb14763ad55 Mon Sep 17 00:00:00 2001 From: Martchus Date: Thu, 28 Nov 2019 21:32:41 +0100 Subject: [PATCH] Consider std::basic_string_view a string in Traits::IsString * Fix e.g. using std::string_view with CppUnit and the tests/testutils.h header * Fix documentation * Possibly a source incompatible change in some rare uses but not worth a major version bump --- misc/traits.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/misc/traits.h b/misc/traits.h index f93b557..edf600f 100644 --- a/misc/traits.h +++ b/misc/traits.h @@ -97,8 +97,11 @@ template struct IsCString : Bool::type>::value || std::is_same::type>::value> { }; -/// \brief Evaluates to Bool if the specified type is a C-string (char * or const char *); otherwise evaluates to Bool. -template struct IsString : Bool::value || IsSpecializationOf::value> { +/// \brief Evaluates to Bool if the specified type is a standard string, standard string view or C-string (char * or const char *); otherwise +/// evaluates to Bool. +template +struct IsString + : Bool::value || IsSpecializationOf::value || IsSpecializationOf::value> { }; /// \brief Evaluates to Bool if the specified type is complete; if the type is only forward-declared it evaluates to Bool.