From debf630ad52968a59871da0e1ba6ee2a8b16deaf Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 24 Sep 2023 16:11:21 +0100 Subject: Add traits for optionals --- slicer/slicer/modelPartsTypes.cpp | 4 ++++ slicer/slicer/modelPartsTypes.h | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/slicer/slicer/modelPartsTypes.cpp b/slicer/slicer/modelPartsTypes.cpp index e65d721..0fa502b 100644 --- a/slicer/slicer/modelPartsTypes.cpp +++ b/slicer/slicer/modelPartsTypes.cpp @@ -27,6 +27,10 @@ namespace Ice { } namespace Slicer { + static_assert(!isOptional::value); + static_assert(isOptional<::Ice::optional>::value); + static_assert(isOptional<::IceUtil::Optional>::value); + using ClassRefMap = std::map>; using ClassNamePair = std::pair; using ClassNameMap = boost::multi_index_container struct isLocal<::Ice::optional> { + static constexpr bool value = isLocal::value; + }; + + template struct isOptional { + static constexpr bool value = false; + }; + + template struct isOptional<::Ice::optional> { + static constexpr bool value = true; + }; + DLL_PUBLIC bool optionalCaseEq(std::string_view a, std::string_view b, bool matchCase); template class ModelPartForRoot : public ModelPartForRootBase { -- cgit v1.2.3