From 47d72fe0917bd6907f9e07fff7b299198b607ef8 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 22 May 2018 19:32:57 +0100 Subject: Provide string_view interface for enum lookup --- slicer/slicer/modelPartsTypes.h | 2 +- slicer/slicer/modelPartsTypes.impl.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/slicer/slicer/modelPartsTypes.h b/slicer/slicer/modelPartsTypes.h index e105f08..2ce204e 100644 --- a/slicer/slicer/modelPartsTypes.h +++ b/slicer/slicer/modelPartsTypes.h @@ -245,7 +245,7 @@ namespace Slicer { static const Metadata metadata; static const Enumerations enumerations; DLL_PUBLIC static const std::string & lookup(T); - DLL_PUBLIC static T lookup(const std::string &); + DLL_PUBLIC static T lookup(const std::string_view &); }; class DLL_PUBLIC ModelPartForSequenceBase : public ModelPart { diff --git a/slicer/slicer/modelPartsTypes.impl.h b/slicer/slicer/modelPartsTypes.impl.h index 79e8645..2e744eb 100644 --- a/slicer/slicer/modelPartsTypes.impl.h +++ b/slicer/slicer/modelPartsTypes.impl.h @@ -563,7 +563,7 @@ namespace Slicer { } template - T ModelPartForEnum::lookup(const std::string & val) + T ModelPartForEnum::lookup(const std::string_view & val) { auto & right = enumerations.template get<1>(); auto i = right.find(val); -- cgit v1.2.3