Posted by
Ferdinando Ametrano-4 on
Jan 28, 2009; 9:40am
URL: http://quantlib.414.s1.nabble.com/inline-calls-to-volatility-bridges-tp9026p9027.html
Hi Jose
On Wed, Jan 28, 2009 at 8:12 AM, Jose Aparicio-Navarro <
[hidden email]> wrote:
> Hi all,
> Maybe I am missing something but should not these methods be inlined?
> In file: swaptionconstantvol.cpp
>
> Volatility ConstantSwaptionVolatility::volatilityImpl(const Date&,
> const Period&,
> Rate) const {
> return volatility_->value();
> }
volatility_ is a Quote, and in swaptionconstantvol.hpp there is only a
forward declaration of the Quote class, while the relevanty header is
only included in the cpp file. So the quote interface cannot be
accessed in the hpp file.
It's coded this way to reduce file dependencies: any change to Quote
would require swaptionconstantvol.cpp to be recompiled, but would not
trigger the recompilation of all files including
swaptionconstantvol.hpp. While it might seem a minor benefit this
approach leads to huge benefits in very large projects where changing
a base class could trigger a very time-consuming rebuild-all
Besides I'm not an expert here, but chances are a good compiler could
inline anyway...
ciao -- Nando
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev