File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -39,17 +39,24 @@ class Function : public Value
3939 * @param function The C++ function to be wrapped
4040 */
4141 Function (const std::function<Value(Parameters&)> &function);
42-
42+
4343 /* *
4444 * Constructor to wrap a function that does not accept parameters
45+ *
46+ * Old C++ compilers do not see a difference between std::function
47+ * objects based on the function signature, so these old compilers
48+ * do not see this method.
49+ *
4550 * @param function The C++ function to be wrapped
4651 */
52+ #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 7) || __clang__
4753 Function (const std::function<Value()> &function) : Function([function](Parameters ¶ms) -> Value {
4854
4955 // call original function, forget about the parameters
5056 return function ();
5157
5258 }) {}
59+ #endif
5360
5461 /* *
5562 * Destructor
You can’t perform that action at this time.
0 commit comments