From 2c484adbab9255498953739cb4d9751353cc804d Mon Sep 17 00:00:00 2001 From: Emiel Bruijntjes Date: Sat, 8 Mar 2014 13:51:08 +0100 Subject: various fixes to make the function call example compilable --- include/value.h | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'include/value.h') diff --git a/include/value.h b/include/value.h index 5800c6a..72bd895 100644 --- a/include/value.h +++ b/include/value.h @@ -72,8 +72,25 @@ public: template Value(const std::vector &input) : Value(Type::Array) { + // index + int i = 0; + + // set all elements + for (auto &elem : input) setRaw(i++, elem); + } + + /** + * Constructor from an initializer list + * @param value + */ + template + Value(const std::initializer_list &value) : Value(Type::Array) + { + // index + int i = 0; + // set all elements - for (size_t i=0; i