|
From: DU V. DE V. F. G. P. <fra...@ca...> - 2007-09-05 14:12:38
|
Hi all,
=20
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 ?).=20
To be as explicit as possible, the DerivedQuote value method would be =
written like this:
=20
template <class UnaryFunction>
inline Real DerivedQuote<UnaryFunction>::value() const {
QL_ENSURE(isValid(), "invalid DerivedQuote");
return UnaryFunction::eval(element_->value());
}
=20
Fran=E7ois
=20
|