Regarding the exception in the first payoff class

This forum is to discuss the book "C++ design patterns and derivatives pricing."

Regarding the exception in the first payoff class

Postby nlr » Sat Sep 03, 2016 11:32 am

Dear Forum,

I am wondering a bit about the exception thrown at the first payoff class if the payoff is not of type put or call. Will the compiler not always make sure we can not end there? I mean, I have to add some nonsense to the enum before I will even be alowed to instantiate such an object so it seems like a counterintuitive thing to protect against.

(This is not a critique, but me trying to learn - I'm a rookie in this game).

Thank you!
nlr
 
Posts: 1
Joined: Thu Sep 01, 2016 7:17 am

Re: Regarding the exception in the first payoff class

Postby mj » Thu Oct 27, 2016 7:51 pm

i am not sure I really get the question.

The routine will exit when an exception is thrown. You can catch exceptions at some outer point if you like or you can simply let the program terminate depending on how serious an application you are building.
mj
Site Admin
 
Posts: 1380
Joined: Fri Jul 27, 2007 7:21 am

Re: Regarding the exception in the first payoff class

Postby Nighyiun » Thu Jun 22, 2017 6:56 am

You can give us more examples of the issues raised.
Nighyiun
 
Posts: 2
Joined: Thu Jun 22, 2017 4:09 am


Return to C++ design patterns and derivatives pricing

Who is online

Users browsing this forum: No registered users and 1 guest

cron