[Quickfix-developers] r1491: nasty bug in Exception class
Brought to you by:
orenmnero
|
From: Caleb E. <cal...@gm...> - 2006-06-02 21:36:38
|
The Exception class constructor has a nasty bug. Can you spot it?
/// Base QuickFIX exception type.
struct Exception : public std::logic_error
{
Exception( const std::string& t, const std::string& d )
: std::logic_error( detail.size() ? t + ": " + d : t ),
type( t ), detail( d )
{}
std::string type;
std::string detail;
};
SPOILER:
The ternary operator is using the "detail" class member, but it hasn't
been constructed yet! Boom!
--
Caleb Epstein
|