From e00c1e3f71bb1840e10a85af53469a81c73c7ef1 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Mon, 30 Apr 2012 21:17:07 +1000 Subject: Functional algorithm. Unoptimised. --- impl/Operator.hpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'impl/Operator.hpp') 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 { const T _value; }; +template +struct Increment: public Operator { + T operator() (const std::vector< Expression* >& args, const VariableAssignment& ass) const { + return (*args[0])(ass) + 1; + } +}; + #include "VariableAssignment.hpp" #include "Expression.hpp" -- cgit v1.2.3