From e345beb770015185eb6b8a44686a134158312fd4 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 28 Dec 2020 17:57:21 +0000 Subject: Simplify and fix fallback/error handlers for missing parameters --- icespider/compile/routeCompiler.cpp | 7 ++----- icespider/core/util.h | 16 ++++++++-------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/icespider/compile/routeCompiler.cpp b/icespider/compile/routeCompiler.cpp index b6ae3ae..a5be4ac 100644 --- a/icespider/compile/routeCompiler.cpp +++ b/icespider/compile/routeCompiler.cpp @@ -490,11 +490,8 @@ namespace IceSpider { fprintbf(5, output, " [this]() { return _pd_%s; }", p.first); } else { - fprintbf(5, output, - " [this]() { return " - "requiredParameterNotFound::type>(\"%s\", _pn_%s); }", - Slice::inputTypeToString(ip->type(), false, "", ip->getMetaData()), - getEnumString(p.second->source), p.first); + fprintbf(5, output, " [this]() { return requiredParameterNotFound<%s>(\"%s\", _pn_%s); }", + paramType, getEnumString(p.second->source), p.first); } } fprintbf(0, output, ");\n"); diff --git a/icespider/core/util.h b/icespider/core/util.h index 39601a9..20864f1 100644 --- a/icespider/core/util.h +++ b/icespider/core/util.h @@ -7,8 +7,8 @@ namespace std::experimental::Ice { template - auto - operator/(const Ice::optional & o, const TF & tf) -> decltype(tf()) + inline const T & + operator/(const Ice::optional & o, const TF & tf) { if (o) { return *o; @@ -17,8 +17,8 @@ namespace std::experimental::Ice { } template - auto - operator/(Ice::optional && o, const TF & tf) -> decltype(tf()) + inline T + operator/(Ice::optional && o, const TF & tf) { if (o) { return std::move(*o); @@ -29,8 +29,8 @@ namespace std::experimental::Ice { namespace std { template - auto - operator/(const std::optional & o, const TF & tf) -> decltype(tf()) + inline const T & + operator/(const std::optional & o, const TF & tf) { if (o) { return *o; @@ -39,8 +39,8 @@ namespace std { } template - auto - operator/(std::optional && o, const TF & tf) -> decltype(tf()) + inline T + operator/(std::optional && o, const TF & tf) { if (o) { return std::move(*o); -- cgit v1.2.3