diff options
author | Carlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au> | 2012-04-30 21:17:07 +1000 |
---|---|---|
committer | Carlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au> | 2012-04-30 21:17:07 +1000 |
commit | e00c1e3f71bb1840e10a85af53469a81c73c7ef1 (patch) | |
tree | 8b24e7be29b364a5a17bdbaabeb3115261bba783 /impl/Operator.hpp | |
parent | 2c22cee1f8fa87c527449a8bdc668ea311fdaf64 (diff) |
Functional algorithm. Unoptimised.
Diffstat (limited to 'impl/Operator.hpp')
-rw-r--r-- | impl/Operator.hpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/impl/Operator.hpp b/impl/Operator.hpp index 3e11443..71a1e68 100644 --- a/impl/Operator.hpp +++ b/impl/Operator.hpp @@ -58,6 +58,13 @@ struct Constant : public Operator<T> { const T _value; }; +template<typename T> +struct Increment: public Operator<T> { + T operator() (const std::vector< Expression<T>* >& args, const VariableAssignment<T>& ass) const { + return (*args[0])(ass) + 1; + } +}; + #include "VariableAssignment.hpp" #include "Expression.hpp" |