Hi all,
A quick question about the DerivedQuote class design: The operation performed by this class is a template parameter yet the actual operation is actually known only at run time. What about using a more informative template so that the operation can be known at compilation time and inlined ? (we would loose the possibility to change the operation at run time but who cares ?).
To be as explicit as possible, the DerivedQuote value method would be written like this:
template <class UnaryFunction>
inline Real DerivedQuote<UnaryFunction>::value() const {
QL_ENSURE(isValid(), "invalid DerivedQuote");
return UnaryFunction::eval(element_->value());
}
François
| Free forum by Nabble | Edit this page |