summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorToon Schoenmakers <toon.schoenmakers@copernica.com>2015-05-18 14:42:36 +0200
committerToon Schoenmakers <toon.schoenmakers@copernica.com>2015-05-18 14:42:36 +0200
commitb7729b98bbd91dcff66c3712f85f477dbd86d4a3 (patch)
tree19a27f551366139a43727d3fcabaa7e031ffbf2b /include
parent9956d998368e0d9f55e1940f4d584fe1554c7418 (diff)
We are now ABI compatible with the latest release again
Diffstat (limited to 'include')
-rw-r--r--include/value.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/value.h b/include/value.h
index 9959a9c..ca3fb9d 100644
--- a/include/value.h
+++ b/include/value.h
@@ -1003,6 +1003,7 @@ public:
* @return Value
*/
Value call(const char *name) const;
+ Value call(const char *name);
/**
*
@@ -1025,6 +1026,20 @@ public:
return exec(name, sizeof...(Args), params);
}
+ template <typename ...Args>
+ Value call(const char *name, Args&&... args)
+ {
+ // store arguments
+ Value vargs[] = { static_cast<Value>(args)... };
+
+ // array of parameters
+ _zval_struct **params[sizeof...(Args)];
+ for(unsigned i=0; i < sizeof...(Args); i++) {params[i] = &vargs[i]._val;}
+
+ // call the function
+ return exec(name, sizeof...(Args), params);
+ }
+
/**
* Retrieve the original implementation
*
@@ -1108,6 +1123,7 @@ private:
* @return Value
*/
Value exec(const char *name, int argc, struct _zval_struct ***params) const;
+ Value exec(const char *name, int argc, struct _zval_struct ***params);
/**
* Refcount - the number of references to the value