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!
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 &UserMsg() const { return m_message_user; }

View File

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

View File

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

View File

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

View File

@ -511,7 +511,7 @@ protected:
public:
wxDialogWithHelpers();
wxDialogWithHelpers(wxWindow *parent, const wxString &title, const pxDialogCreationFlags &cflags = pxDialogCreationFlags());
virtual ~wxDialogWithHelpers() throw();
virtual ~wxDialogWithHelpers() = default;
void Init(const pxDialogCreationFlags &cflags);
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::~BaseException() throw() {}
BaseException &BaseException::SetBothMsgs(const wxChar *msg_diag)
{
m_message_user = msg_diag ? wxString(wxGetTranslation(msg_diag)) : wxString("");

View File

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

View File

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

View File

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

View File

@ -132,10 +132,6 @@ wxDialogWithHelpers::wxDialogWithHelpers(wxWindow *parent, const wxString &title
SetMinSize(cflags.MinimumSize);
}
wxDialogWithHelpers::~wxDialogWithHelpers() throw()
{
}
void wxDialogWithHelpers::Init(const pxDialogCreationFlags &cflags)
{
// 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)
SingleCoreAffinity::SingleCoreAffinity() {}
SingleCoreAffinity::~SingleCoreAffinity() throw() {}
SingleCoreAffinity::SingleCoreAffinity() = default;
SingleCoreAffinity::~SingleCoreAffinity() throw() = default;