Diferença entre "lançar novo BadConversion (" xxx ")" e "lançar novo BadConversion (" xxx ")"
// http://www.parashift.com/c++-faq-lite/misc-technical-issues.html
class BadConversion : public std::runtime_error {
public:
BadConversion(std::string const& s)
: std::runtime_error(s)
{ }
};
inline std::string stringify(double x)
{
std::ostringstream o;
if (!(o << x))
throw BadConversion("stringify(double)");
// throw new BadConversion("stringify(double)");
return o.str();
}
[Q1] Quando lançamos uma exceção na função, qual é a diferença entre lançar novo ClassName () e lançar ClassName ()?
[Q2] Qual é o melhor?
Obrigado