+template<typename T>
+class SGDifferenceExpression : public SGNaryExpression<T> {
+public:
+ SGDifferenceExpression()
+ { }
+ SGDifferenceExpression(SGExpression<T>* expr0, SGExpression<T>* expr1)
+ : SGNaryExpression<T>(expr0, expr1)
+ { }
+ virtual void eval(T& value, const simgear::expression::Binding* b) const
+ {
+ value = getOperand(0)->getValue(b);
+ unsigned sz = SGNaryExpression<T>::getNumOperands();
+ for (unsigned i = 1; i < sz; ++i)
+ value -= getOperand(i)->getValue(b);
+ }
+ using SGNaryExpression<T>::getValue;
+ using SGNaryExpression<T>::getOperand;
+};
+