common: use = default instead of trivial constructor/destructor

reported by clang-tidy

Note: drop throw() specifier as it is the 'default' in C++11 for
destructor
This commit is contained in:
Gregory Hainaut 2017-05-06 13:00:55 +02:00
parent 595ad99a5b
commit 9e101c9ef0
11 changed files with 13 additions and 30 deletions

View File

@ -85,7 +85,7 @@ protected:
wxString m_message_user; // (translated) a "detailed" message of what disastrous thing has occurred! wxString m_message_user; // (translated) a "detailed" message of what disastrous thing has occurred!
public: public:
virtual ~BaseException() throw() = 0; // the =0; syntax forces this class into "abstract" mode. virtual ~BaseException() = default;
const wxString &DiagMsg() const { return m_message_diag; } const wxString &DiagMsg() const { return m_message_diag; }
const wxString &UserMsg() const { return m_message_user; } const wxString &UserMsg() const { return m_message_user; }

View File

@ -110,7 +110,7 @@ public:
class IniLoader : public IniInterface class IniLoader : public IniInterface
{ {
public: public:
virtual ~IniLoader() throw(); virtual ~IniLoader() = default;
explicit IniLoader(); explicit IniLoader();
explicit IniLoader(wxConfigBase &config); explicit IniLoader(wxConfigBase &config);
explicit IniLoader(wxConfigBase *config); explicit IniLoader(wxConfigBase *config);
@ -148,7 +148,7 @@ protected:
class IniSaver : public IniInterface class IniSaver : public IniInterface
{ {
public: public:
virtual ~IniSaver(); virtual ~IniSaver() = default;
explicit IniSaver(); explicit IniSaver();
explicit IniSaver(wxConfigBase &config); explicit IniSaver(wxConfigBase &config);
explicit IniSaver(wxConfigBase *config); explicit IniSaver(wxConfigBase *config);

View File

@ -144,7 +144,7 @@ protected:
public: public:
FastFormatAscii(); FastFormatAscii();
~FastFormatAscii() throw(); ~FastFormatAscii() = default;
FastFormatAscii &Write(const char *fmt, ...); FastFormatAscii &Write(const char *fmt, ...);
FastFormatAscii &WriteV(const char *fmt, va_list argptr); FastFormatAscii &WriteV(const char *fmt, va_list argptr);
@ -187,7 +187,7 @@ protected:
public: public:
FastFormatUnicode(); FastFormatUnicode();
~FastFormatUnicode() throw(); ~FastFormatUnicode() = default;
FastFormatUnicode &Write(const char *fmt, ...); FastFormatUnicode &Write(const char *fmt, ...);
FastFormatUnicode &Write(const wxChar *fmt, ...); FastFormatUnicode &Write(const wxChar *fmt, ...);

View File

@ -380,7 +380,7 @@ protected:
MsgButtons m_Buttons; MsgButtons m_Buttons;
public: public:
virtual ~pxMessageBoxEvent() throw() {} virtual ~pxMessageBoxEvent() = default;
virtual pxMessageBoxEvent *Clone() const { return new pxMessageBoxEvent(*this); } virtual pxMessageBoxEvent *Clone() const { return new pxMessageBoxEvent(*this); }
pxMessageBoxEvent() {} pxMessageBoxEvent() {}
@ -404,7 +404,7 @@ protected:
wxString m_Stacktrace; wxString m_Stacktrace;
public: public:
virtual ~pxAssertionEvent() throw() {} virtual ~pxAssertionEvent() = default;
virtual pxAssertionEvent *Clone() const { return new pxAssertionEvent(*this); } virtual pxAssertionEvent *Clone() const { return new pxAssertionEvent(*this); }
pxAssertionEvent(const wxString &content = wxEmptyString, const wxString &trace = wxEmptyString, SynchronousActionState *instdata = NULL); pxAssertionEvent(const wxString &content = wxEmptyString, const wxString &trace = wxEmptyString, SynchronousActionState *instdata = NULL);

View File

@ -511,7 +511,7 @@ protected:
public: public:
wxDialogWithHelpers(); wxDialogWithHelpers();
wxDialogWithHelpers(wxWindow *parent, const wxString &title, const pxDialogCreationFlags &cflags = pxDialogCreationFlags()); wxDialogWithHelpers(wxWindow *parent, const wxString &title, const pxDialogCreationFlags &cflags = pxDialogCreationFlags());
virtual ~wxDialogWithHelpers() throw(); virtual ~wxDialogWithHelpers() = default;
void Init(const pxDialogCreationFlags &cflags); void Init(const pxDialogCreationFlags &cflags);
void AddOkCancel(wxSizer &sizer, bool hasApply = false); void AddOkCancel(wxSizer &sizer, bool hasApply = false);

View File

@ -143,8 +143,6 @@ __fi void pxOnAssert(const DiagnosticOrigin &origin, const FastFormatUnicode &ms
// BaseException (implementations) // BaseException (implementations)
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
BaseException::~BaseException() throw() {}
BaseException &BaseException::SetBothMsgs(const wxChar *msg_diag) BaseException &BaseException::SetBothMsgs(const wxChar *msg_diag)
{ {
m_message_user = msg_diag ? wxString(wxGetTranslation(msg_diag)) : wxString(""); m_message_user = msg_diag ? wxString(wxGetTranslation(msg_diag)) : wxString("");

View File

@ -132,10 +132,6 @@ FastFormatUnicode::FastFormatUnicode()
Clear(); Clear();
} }
FastFormatUnicode::~FastFormatUnicode() throw()
{
}
void FastFormatUnicode::Clear() void FastFormatUnicode::Clear()
{ {
m_Length = 0; m_Length = 0;
@ -261,10 +257,6 @@ FastFormatAscii::FastFormatAscii()
Clear(); Clear();
} }
FastFormatAscii::~FastFormatAscii() throw()
{
}
void FastFormatAscii::Clear() void FastFormatAscii::Clear()
{ {
m_dest.GetPtr()[0] = 0; m_dest.GetPtr()[0] = 0;

View File

@ -98,6 +98,7 @@ IniLoader::IniLoader(wxConfigBase &config)
: IniInterface(config) : IniInterface(config)
{ {
} }
IniLoader::IniLoader(wxConfigBase *config) IniLoader::IniLoader(wxConfigBase *config)
: IniInterface(config) : IniInterface(config)
{ {
@ -107,8 +108,6 @@ IniLoader::IniLoader()
: IniInterface() : IniInterface()
{ {
} }
IniLoader::~IniLoader() throw() {}
void IniLoader::Entry(const wxString &var, wxString &value, const wxString defvalue) void IniLoader::Entry(const wxString &var, wxString &value, const wxString defvalue)
{ {
@ -118,7 +117,6 @@ void IniLoader::Entry(const wxString &var, wxString &value, const wxString defva
value = defvalue; value = defvalue;
} }
void IniLoader::Entry(const wxString &var, wxDirName &value, const wxDirName defvalue, bool isAllowRelative) void IniLoader::Entry(const wxString &var, wxDirName &value, const wxDirName defvalue, bool isAllowRelative)
{ {
wxString dest; wxString dest;
@ -271,17 +269,16 @@ IniSaver::IniSaver(wxConfigBase &config)
: IniInterface(config) : IniInterface(config)
{ {
} }
IniSaver::IniSaver(wxConfigBase *config) IniSaver::IniSaver(wxConfigBase *config)
: IniInterface(config) : IniInterface(config)
{ {
} }
IniSaver::IniSaver() IniSaver::IniSaver()
: IniInterface() : IniInterface()
{ {
} }
IniSaver::~IniSaver() {}
void IniSaver::Entry(const wxString &var, wxString &value, const wxString defvalue) void IniSaver::Entry(const wxString &var, wxString &value, const wxString defvalue)
{ {

View File

@ -229,7 +229,7 @@ protected:
void (*m_Method)(); void (*m_Method)();
public: public:
virtual ~pxRpcEvent() throw() {} virtual ~pxRpcEvent() = default;
virtual pxRpcEvent *Clone() const { return new pxRpcEvent(*this); } virtual pxRpcEvent *Clone() const { return new pxRpcEvent(*this); }
explicit pxRpcEvent(void (*method)() = NULL, SynchronousActionState *sema = NULL) explicit pxRpcEvent(void (*method)() = NULL, SynchronousActionState *sema = NULL)

View File

@ -132,10 +132,6 @@ wxDialogWithHelpers::wxDialogWithHelpers(wxWindow *parent, const wxString &title
SetMinSize(cflags.MinimumSize); SetMinSize(cflags.MinimumSize);
} }
wxDialogWithHelpers::~wxDialogWithHelpers() throw()
{
}
void wxDialogWithHelpers::Init(const pxDialogCreationFlags &cflags) void wxDialogWithHelpers::Init(const pxDialogCreationFlags &cflags)
{ {
// Note to self: if any comments indicate platform specific behaviour then // Note to self: if any comments indicate platform specific behaviour then

View File

@ -29,5 +29,5 @@ void x86capabilities::CountLogicalCores()
} }
// Not implemented yet for linux (see cpudetect_internal.h for details) // Not implemented yet for linux (see cpudetect_internal.h for details)
SingleCoreAffinity::SingleCoreAffinity() {} SingleCoreAffinity::SingleCoreAffinity() = default;
SingleCoreAffinity::~SingleCoreAffinity() throw() {} SingleCoreAffinity::~SingleCoreAffinity() throw() = default;