summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2018-05-22 19:32:57 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2018-07-22 13:15:30 +0100
commit47d72fe0917bd6907f9e07fff7b299198b607ef8 (patch)
tree8fdfc44df4cb6c2a420d41d3039e962e89664ca5
parentMulti-index (diff)
downloadslicer-47d72fe0917bd6907f9e07fff7b299198b607ef8.tar.bz2
slicer-47d72fe0917bd6907f9e07fff7b299198b607ef8.tar.xz
slicer-47d72fe0917bd6907f9e07fff7b299198b607ef8.zip
Provide string_view interface for enum lookup
-rw-r--r--slicer/slicer/modelPartsTypes.h2
-rw-r--r--slicer/slicer/modelPartsTypes.impl.h2
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<typename T>
- T ModelPartForEnum<T>::lookup(const std::string & val)
+ T ModelPartForEnum<T>::lookup(const std::string_view & val)
{
auto & right = enumerations.template get<1>();
auto i = right.find(val);