aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/sibs/Functional.hpp14
1 files changed, 13 insertions, 1 deletions
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<Function> connections;
};
+
+ template <typename T>
+ static Function<T> makeFunction(T *begin, T *end)
+ {
+ return Function<T>(begin, end);
+ }
+
+ template <typename T>
+ static Function<T> makeFunction(std::vector<T> &vec)
+ {
+ return Function<T>(vec.data(), vec.data() + vec.size());
+ }
}