This fixes warnings from Intel compiler about overriding function using a
different exception specification than the base one and also incidentally
provides a handy macro that can be useful in other situations.
Closes #14826.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72978
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
- Add wxFile::ReadAll() for consistency with wxFFile.
- Add wxDateTime::DiffAsDateSpan() and wxDateSpan::GetTotalMonths() (jonasr).
- Add wxVector::assign() (Jonas Rydberg).
+- Add wxNOEXCEPT (Marian VooDooMan Meravy).
- Added Nepali translation (Him Prasad Gautam).
All (GUI):
#define DECLARE_NO_ASSIGN_CLASS(classname) \
wxDECLARE_NO_ASSIGN_CLASS(classname);
+/* Macro that can be used to indicate that a function doesn't throw. */
+#if defined(__cplusplus) && __cplusplus >= 199711L /* C++98 */
+# if __cplusplus >= 201103L /* >= C++11 */
+# define wxNOEXCEPT noexcept
+# else
+# define wxNOEXCEPT throw()
+# endif
+#else
+# define wxNOEXCEPT
+#endif
+
/* --------------------------------------------------------------------------- */
/* If a manifest is being automatically generated, add common controls 6 to it */
/* --------------------------------------------------------------------------- */
Create(parent, id, value, pos, size, style, validator, name);
}
- virtual ~wxTextCtrl();
+ virtual ~wxTextCtrl() wxNOEXCEPT;
bool Create(wxWindow *parent, wxWindowID id,
const wxString& value = wxEmptyString,
{
public:
wxStdInputStreamBuffer(wxInputStream& stream);
- virtual ~wxStdInputStreamBuffer() { }
+ virtual ~wxStdInputStreamBuffer() wxNOEXCEPT { }
protected:
virtual std::streambuf *setbuf(char *s, std::streamsize n);
{
public:
wxStdInputStream(wxInputStream& stream);
- virtual ~wxStdInputStream() { }
+ virtual ~wxStdInputStream() wxNOEXCEPT { }
protected:
wxStdInputStreamBuffer m_streamBuffer;
{
public:
wxStdOutputStreamBuffer(wxOutputStream& stream);
- virtual ~wxStdOutputStreamBuffer() { }
+ virtual ~wxStdOutputStreamBuffer() wxNOEXCEPT { }
protected:
virtual std::streambuf *setbuf(char *s, std::streamsize n);
{
public:
wxStdOutputStream(wxOutputStream& stream);
- virtual ~wxStdOutputStream() { }
+ virtual ~wxStdOutputStream() wxNOEXCEPT { }
protected:
wxStdOutputStreamBuffer m_streamBuffer;
// --------
wxTextCtrlBase() { }
- virtual ~wxTextCtrlBase() { }
+ virtual ~wxTextCtrlBase() wxNOEXCEPT { }
// more readable flag testing methods
*/
void wxVaCopy(va_list argptrDst, va_list argptrSrc);
+/**
+ Macro that can be used to indicate that a function doesn't throw any
+ exceptions.
+
+ This macro expands to `noexcept` when using C++11 compiler or `throw()` for
+ older C++ compilers or nothing when used with a C++ compiler too old to
+ support even this.
+
+ Notice that `noexcept` and `throw()` have different semantics in case an
+ exception @e is thrown, so this macro should be used only if you don't rely
+ on the behaviour provided by the latter but not the former.
+
+ @since 2.9.5
+ */
+#define wxNOEXCEPT
+
//@}
{
public:
wxComboCtrlTextCtrl() : wxTextCtrl() { }
- virtual ~wxComboCtrlTextCtrl() { }
+ virtual ~wxComboCtrlTextCtrl() wxNOEXCEPT { }
virtual wxWindow *GetMainWindowOfCompositeControl()
{
SetSizeHints(wxDefaultCoord, wxDefaultCoord);
}
- virtual ~wxSpinCtrlTextGeneric()
+ virtual ~wxSpinCtrlTextGeneric() wxNOEXCEPT
{
// MSW sends extra kill focus event on destroy
if (m_spin)