From 44e4d1335a2e15fe7ce6852436259eb1138d44c4 Mon Sep 17 00:00:00 2001 From: Martchus Date: Mon, 29 Oct 2018 23:16:16 +0100 Subject: [PATCH] Fix Traits::IsSpecializationOf to ignore cv qualifier So eg. const/volatile std::string is also considered a specialization of std::basic_string like one would expect. --- misc/traits.h | 12 +++++++++--- tests/traitstests.cpp | 6 ++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/misc/traits.h b/misc/traits.h index f1aac92..04fc3ba 100644 --- a/misc/traits.h +++ b/misc/traits.h @@ -54,11 +54,17 @@ template using EnableIfAny = typename std::enable_if using DisableIfAny = typename std::enable_if::value, Detail::Enabler>::type; -/// \brief Evaluates to Bool if the specified type is based on the specified \tparam Template; otherwise evaluates to Bool. -template class Template> struct IsSpecializationOf : Bool { +/// \cond +namespace Detail { +template class Template> struct IsSpecializationOfHelper : Bool { }; +template