summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2020-12-28 17:57:21 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2020-12-28 17:57:21 +0000
commite345beb770015185eb6b8a44686a134158312fd4 (patch)
treeb045c9a2fb34cf4cd4bad995a575e294112cd638
parentRemove unused helper function (diff)
downloadicespider-e345beb770015185eb6b8a44686a134158312fd4.tar.bz2
icespider-e345beb770015185eb6b8a44686a134158312fd4.tar.xz
icespider-e345beb770015185eb6b8a44686a134158312fd4.zip
Simplify and fix fallback/error handlers for missing parametersicespider-0.6.7
-rw-r--r--icespider/compile/routeCompiler.cpp7
-rw-r--r--icespider/core/util.h16
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<std::remove_reference<%s>::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<typename T, typename TF>
- auto
- operator/(const Ice::optional<T> & o, const TF & tf) -> decltype(tf())
+ inline const T &
+ operator/(const Ice::optional<T> & o, const TF & tf)
{
if (o) {
return *o;
@@ -17,8 +17,8 @@ namespace std::experimental::Ice {
}
template<typename T, typename TF>
- auto
- operator/(Ice::optional<T> && o, const TF & tf) -> decltype(tf())
+ inline T
+ operator/(Ice::optional<T> && o, const TF & tf)
{
if (o) {
return std::move(*o);
@@ -29,8 +29,8 @@ namespace std::experimental::Ice {
namespace std {
template<typename T, typename TF>
- auto
- operator/(const std::optional<T> & o, const TF & tf) -> decltype(tf())
+ inline const T &
+ operator/(const std::optional<T> & o, const TF & tf)
{
if (o) {
return *o;
@@ -39,8 +39,8 @@ namespace std {
}
template<typename T, typename TF>
- auto
- operator/(std::optional<T> && o, const TF & tf) -> decltype(tf())
+ inline T
+ operator/(std::optional<T> && o, const TF & tf)
{
if (o) {
return std::move(*o);