Posted by
DU VIGNAUD DE VILLEFORT FRANCOIS GASAPRD PHI on
URL: http://quantlib.414.s1.nabble.com/coding-style-tp9335p9336.html
>Non necessarily. Let's say we have:
>- a class Foo declared in foo.hpp and implemented in foo.cpp;
>- a class Bar that stores, say, a pointer to Foo. In bar.hpp, we
> only need a forward declaration of Foo. In bar.cpp (where the
> Foo object is manipulated) we need to include foo.hpp.
>- a class Baz which takes a pointer to Foo as argument, passes it
> to a Bar, and stores (and possibly manipulates) the resulting Bar.
>Since Baz is not going to use Foo directly, baz.cpp does not need to
>include its definition---the forward declaration in bar.hpp is
>enough---and can be compiled successfully without including foo.hpp.
Ok you win me over, thanks for this detailled explanation.
Regards,
François
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev