From d265c4422c8100665cc5bf302407172ea6ce07cd Mon Sep 17 00:00:00 2001 From: dec05eba 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(-) 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