exception handling - C++ , is this goto statement warranted? -
I changed a little title because I thought this is a more appropriate question.
Would you refactor it (looks like legitimate use of Goto)? If you go to the statement, how will you refactor the following code?
if (data. Device) {try {...} hold (const std :: exception & amp;) {goto; } ... // There are more things that should not be caught:; }
Full details
if you try to use the #ifdef HAVE_GPU // GPU device (data. Device) {try {Integral :: Gpu eri (S), R, Q, Block. (Shell); Eri (base center (), quartets, data. Device); } // If GPU fails, then propagate CPU cache (std :: exception); } Data. Device + size =; Host_index.extend (block_index); Block_index.data.clear (); done: ; } Most preferred after #endif
thanks
, I decided to go with the flag, but Mr. With York comment.
> Thank you to all
if (data. Device) {bool Status = true; Try {...} hold (std :: exception) {status = false; } If (position) {... / more things that should not be caught}}
Comments
Post a Comment