Skip to content

Commit

Permalink
STYLE: Throw expression should throw anonymous temporary values instead
Browse files Browse the repository at this point in the history
  • Loading branch information
hjmjohnson authored and dzenanz committed Feb 15, 2021
1 parent cde72b3 commit 8774989
Showing 1 changed file with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ ANTSNeighborhoodCorrelationImageToImageMetricv4GetValueAndDerivativeThreader<TDo
// NOTE: there must be a cleaner way to do this:
std::string msg("Caught exception: \n");
msg += exc.what();
ExceptionObject err(__FILE__, __LINE__, msg);
throw err;
throw ExceptionObject(__FILE__, __LINE__, msg);
}

/* Assign the results */
Expand Down Expand Up @@ -196,8 +195,7 @@ ANTSNeighborhoodCorrelationImageToImageMetricv4GetValueAndDerivativeThreader<
// NOTE: there must be a cleaner way to do this:
std::string msg("Caught exception: \n");
msg += exc.what();
ExceptionObject err(__FILE__, __LINE__, msg);
throw err;
throw ExceptionObject(__FILE__, __LINE__, msg);
}


Expand Down Expand Up @@ -281,8 +279,7 @@ ANTSNeighborhoodCorrelationImageToImageMetricv4GetValueAndDerivativeThreader<
// NOTE: there must be a cleaner way to do this:
std::string msg("Caught exception: \n");
msg += exc.what();
ExceptionObject err(__FILE__, __LINE__, msg);
throw err;
throw ExceptionObject(__FILE__, __LINE__, msg);
}
if (pointIsValid)
{
Expand Down Expand Up @@ -475,8 +472,7 @@ ANTSNeighborhoodCorrelationImageToImageMetricv4GetValueAndDerivativeThreader<
// NOTE: there must be a cleaner way to do this:
std::string msg("Caught exception: \n");
msg += exc.what();
ExceptionObject err(__FILE__, __LINE__, msg);
throw err;
throw ExceptionObject(__FILE__, __LINE__, msg);
}

if (pointIsValid)
Expand Down Expand Up @@ -624,8 +620,7 @@ ANTSNeighborhoodCorrelationImageToImageMetricv4GetValueAndDerivativeThreader<TDo
// NOTE: there must be a cleaner way to do this:
std::string msg("Caught exception: \n");
msg += exc.what();
ExceptionObject err(__FILE__, __LINE__, msg);
throw err;
throw ExceptionObject(__FILE__, __LINE__, msg);
}

/* Assign the results */
Expand Down

0 comments on commit 8774989

Please sign in to comment.