summaryrefslogtreecommitdiff
path: root/impl/Operator.hpp
diff options
context:
space:
mode:
authorCarlo Zancanaro <carlo@carlo-laptop>2012-05-01 00:01:23 +1000
committerCarlo Zancanaro <carlo@carlo-laptop>2012-05-01 00:01:23 +1000
commit1bf6761d36d4a08c1ebe3c496cefb3c7569ba95e (patch)
tree78319a6142799639a108c2988088c44e0de3b21d /impl/Operator.hpp
parente00c1e3f71bb1840e10a85af53469a81c73c7ef1 (diff)
Update the example to be the one from the paper.
Diffstat (limited to 'impl/Operator.hpp')
-rw-r--r--impl/Operator.hpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/impl/Operator.hpp b/impl/Operator.hpp
index 71a1e68..2c5af75 100644
--- a/impl/Operator.hpp
+++ b/impl/Operator.hpp
@@ -59,10 +59,13 @@ struct Constant : public Operator<T> {
};
template<typename T>
-struct Increment: public Operator<T> {
+struct Addition: public Operator<T> {
+ Addition(int i) : _value(i) { }
T operator() (const std::vector< Expression<T>* >& args, const VariableAssignment<T>& ass) const {
- return (*args[0])(ass) + 1;
+ return (*args[0])(ass) + _value;
}
+ private:
+ int _value;
};
#include "VariableAssignment.hpp"