summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/function.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/function.h b/include/function.h
index 7073f84..e6693d7 100644
--- a/include/function.h
+++ b/include/function.h
@@ -39,17 +39,24 @@ public:
* @param function The C++ function to be wrapped
*/
Function(const std::function<Value(Parameters&)> &function);
-
+
/**
* Constructor to wrap a function that does not accept parameters
+ *
+ * Old C++ compilers do not see a difference between std::function
+ * objects based on the function signature, so these old compilers
+ * do not see this method.
+ *
* @param function The C++ function to be wrapped
*/
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 7) || __clang__
Function(const std::function<Value()> &function) : Function([function](Parameters &params) -> Value {
// call original function, forget about the parameters
return function();
}) {}
+#endif
/**
* Destructor