From d03d8c260fbae29f6f87d459670a25130beb2b48 Mon Sep 17 00:00:00 2001 From: dec05eba <0xdec05eba@gmail.com> Date: Wed, 8 Aug 2018 23:16:21 +0200 Subject: Add helper functions --- include/sibs/Functional.hpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'include/sibs') diff --git a/include/sibs/Functional.hpp b/include/sibs/Functional.hpp index 53d8ff0..7c51883 100644 --- a/include/sibs/Functional.hpp +++ b/include/sibs/Functional.hpp @@ -74,7 +74,7 @@ namespace sibs } - Function& merge(Function &otherFunc) + Function& merge(const Function &otherFunc) { connections.push_back(otherFunc); return *this; @@ -110,4 +110,16 @@ namespace sibs T *endIt; std::vector connections; }; + + template + static Function makeFunction(T *begin, T *end) + { + return Function(begin, end); + } + + template + static Function makeFunction(std::vector &vec) + { + return Function(vec.data(), vec.data() + vec.size()); + } } -- cgit v1.2.3