I'm trying to code Put-Call Parity function in CallOption and PutOption derived class. I'd like this function passes the reference of the object as argument.
This is the signature of the function in the CallOption.hpp
double PCParity(const PutOption& put_option) const;
and similarly in PutOption.hpp
double PCParity(const CallOption& call_option) const;
I, of course, included CallOption.hpp in PutOption.hpp and reciprocally.
But I get the following errors:
Does it mean that I cannot call two derived classes simultaneously at the compiling time?
Any help is very much appreciated. :(
Thank you @drescherjm for the comments, while you replied I kept searching a solution to my problem. As you said I should use the forward declaration like stated here:
What are forward declarations in C++?.
Indeed I should include CallOption.hpp
in PutOption.cpp
and similarly for the CallOption class. Then, declare at the top of CallOption.hpp
, as follows:
Class PutOption;
Class CallOption: public Option
{
}
Many thanks :)