diff options
author | Carlo Zancanaro <carlo@carlo-laptop> | 2012-04-06 14:02:26 +1000 |
---|---|---|
committer | Carlo Zancanaro <carlo@carlo-laptop> | 2012-04-06 14:02:26 +1000 |
commit | 5d7252681da3b26845fc4e5dcf0b0e94ed9fabb1 (patch) | |
tree | 20bc0a6b62390aabda0b8c446d3a2177990863f6 /impl/Constant.h | |
parent | 83e2c574bdefe2d040cdfbe20a73380a0f0123dd (diff) |
Move everything into impl/ and add a Makefile.
Diffstat (limited to 'impl/Constant.h')
-rw-r--r-- | impl/Constant.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/impl/Constant.h b/impl/Constant.h new file mode 100644 index 0000000..bab8cd9 --- /dev/null +++ b/impl/Constant.h @@ -0,0 +1,22 @@ +#ifndef CONSTANT_H +#define CONSTANT_H + +#include "Expression.h" + +template<class T> +struct Constant : public Expression<T> { + Constant(const T& value) : _value(value) { } + + T value() const { + return this->_value; + } + + T eval(const std::map<std::string, T>&) const { + return _value; + } + + private: + const T _value; +}; + +#endif |