diff --git a/include/wx/arrstr.h b/include/wx/arrstr.h index 8b2a6325c9..9e2711acd9 100644 --- a/include/wx/arrstr.h +++ b/include/wx/arrstr.h @@ -105,7 +105,7 @@ public: for ( size_t n = 0; n < src.size(); n++ ) Add(src[n]); } - wxEXPLICIT wxSortedArrayString(wxArrayString::CompareFunction compareFunction) + explicit wxSortedArrayString(wxArrayString::CompareFunction compareFunction) : wxSortedArrayStringBase(compareFunction) { } @@ -151,7 +151,7 @@ public: // wouldn't be needed if the 'explicit' keyword was supported by all // compilers, or if this was protected ctor for wxSortedArrayString, // but we're stuck with it now. - wxEXPLICIT wxArrayString(int autoSort) { Init(autoSort != 0); } + explicit wxArrayString(int autoSort) { Init(autoSort != 0); } // C string array ctor wxArrayString(size_t sz, const char** a); wxArrayString(size_t sz, const wchar_t** a); @@ -263,7 +263,7 @@ public: public: pointer m_ptr; reverse_iterator() : m_ptr(NULL) { } - wxEXPLICIT reverse_iterator(pointer ptr) : m_ptr(ptr) { } + explicit reverse_iterator(pointer ptr) : m_ptr(ptr) { } reverse_iterator(const itor& it) : m_ptr(it.m_ptr) { } reference operator*() const { return *m_ptr; } pointer operator->() const { return m_ptr; } @@ -289,7 +289,7 @@ public: public: pointer m_ptr; const_reverse_iterator() : m_ptr(NULL) { } - wxEXPLICIT const_reverse_iterator(pointer ptr) : m_ptr(ptr) { } + explicit const_reverse_iterator(pointer ptr) : m_ptr(ptr) { } const_reverse_iterator(const itor& it) : m_ptr(it.m_ptr) { } const_reverse_iterator(const reverse_iterator& it) : m_ptr(it.m_ptr) { } reference operator*() const { return *m_ptr; } @@ -389,7 +389,7 @@ public: wxSortedArrayString(const wxArrayString& array) : wxArrayString(true) { Copy(array); } - wxEXPLICIT wxSortedArrayString(CompareFunction compareFunction) + explicit wxSortedArrayString(CompareFunction compareFunction) : wxArrayString(true) { m_compareFunction = compareFunction; } }; diff --git a/include/wx/dataview.h b/include/wx/dataview.h index 5039b437c2..d92a21eee9 100644 --- a/include/wx/dataview.h +++ b/include/wx/dataview.h @@ -87,7 +87,7 @@ class wxDataViewItem : public wxItemId { public: wxDataViewItem() : wxItemId() { } - wxEXPLICIT wxDataViewItem(void* pItem) : wxItemId(pItem) { } + explicit wxDataViewItem(void* pItem) : wxItemId(pItem) { } }; WX_DEFINE_ARRAY(wxDataViewItem, wxDataViewItemArray); diff --git a/include/wx/defs.h b/include/wx/defs.h index fe5fdb48f7..93db4d7c0e 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -229,23 +229,8 @@ typedef short int WXTYPE; /* wrap it in this guard, but such cases should still be relatively rare. */ #define wxUSE_NESTED_CLASSES 1 -/* check for explicit keyword support */ -#ifndef HAVE_EXPLICIT - #if defined(__VISUALC__) - #define HAVE_EXPLICIT - #elif defined(__GNUC__) - #define HAVE_EXPLICIT - #elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x0520) - /* BC++ 4.52 doesn't support explicit, CBuilder 1 does */ - #define HAVE_EXPLICIT - #endif -#endif /* !HAVE_EXPLICIT */ - -#ifdef HAVE_EXPLICIT - #define wxEXPLICIT explicit -#else /* !HAVE_EXPLICIT */ - #define wxEXPLICIT -#endif /* HAVE_EXPLICIT/!HAVE_EXPLICIT */ +/* This macro is obsolete, use the 'explicit' keyword in the new code. */ +#define wxEXPLICIT explicit /* check for override keyword support */ #ifndef HAVE_OVERRIDE diff --git a/include/wx/dlist.h b/include/wx/dlist.h index d25428de29..e44e3e3e46 100644 --- a/include/wx/dlist.h +++ b/include/wx/dlist.h @@ -739,7 +739,7 @@ public: { return it.m_node == m_node; } }; - wxEXPLICIT wxDList(size_type n, const_reference v = value_type()) + explicit wxDList(size_type n, const_reference v = value_type()) { assign(n, v); } wxDList(const const_iterator& first, const const_iterator& last) { assign(first, last); } diff --git a/include/wx/font.h b/include/wx/font.h index cbd3cada8f..3e0ee14102 100644 --- a/include/wx/font.h +++ b/include/wx/font.h @@ -123,9 +123,9 @@ public: { InitPointSize(-1); } // These ctors specify the font size, either in points or in pixels. - wxEXPLICIT wxFontInfo(int pointSize) + explicit wxFontInfo(int pointSize) { InitPointSize(pointSize); } - wxEXPLICIT wxFontInfo(const wxSize& pixelSize) : m_pixelSize(pixelSize) + explicit wxFontInfo(const wxSize& pixelSize) : m_pixelSize(pixelSize) { Init(); } // Setters for the various attributes. All of them return the object itself diff --git a/include/wx/generic/grideditors.h b/include/wx/generic/grideditors.h index faa1007c65..c1b8206caa 100644 --- a/include/wx/generic/grideditors.h +++ b/include/wx/generic/grideditors.h @@ -53,7 +53,7 @@ private: class WXDLLIMPEXP_ADV wxGridCellTextEditor : public wxGridCellEditor { public: - wxEXPLICIT wxGridCellTextEditor(size_t maxChars = 0); + explicit wxGridCellTextEditor(size_t maxChars = 0); virtual void Create(wxWindow* parent, wxWindowID id, diff --git a/include/wx/generic/private/textmeasure.h b/include/wx/generic/private/textmeasure.h index 2b31d02831..6cd900e945 100644 --- a/include/wx/generic/private/textmeasure.h +++ b/include/wx/generic/private/textmeasure.h @@ -17,9 +17,9 @@ class wxTextMeasure : public wxTextMeasureBase { public: - wxEXPLICIT wxTextMeasure(const wxDC *dc, const wxFont *font = NULL) + explicit wxTextMeasure(const wxDC *dc, const wxFont *font = NULL) : wxTextMeasureBase(dc, font) {} - wxEXPLICIT wxTextMeasure(const wxWindow *win, const wxFont *font = NULL) + explicit wxTextMeasure(const wxWindow *win, const wxFont *font = NULL) : wxTextMeasureBase(win, font) {} protected: diff --git a/include/wx/gtk/bitmap.h b/include/wx/gtk/bitmap.h index 3b3cf99cff..ea54328dcf 100644 --- a/include/wx/gtk/bitmap.h +++ b/include/wx/gtk/bitmap.h @@ -82,7 +82,7 @@ public: wxBitmap(const wxImage& image, int depth = wxBITMAP_SCREEN_DEPTH, double scale = 1.0); #endif // wxUSE_IMAGE wxBitmap(GdkPixbuf* pixbuf, int depth = 0); - wxEXPLICIT wxBitmap(const wxCursor& cursor); + explicit wxBitmap(const wxCursor& cursor); virtual ~wxBitmap(); bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH) wxOVERRIDE; diff --git a/include/wx/gtk/glcanvas.h b/include/wx/gtk/glcanvas.h index f194e60f37..c60c601b8e 100644 --- a/include/wx/gtk/glcanvas.h +++ b/include/wx/gtk/glcanvas.h @@ -29,7 +29,7 @@ public: const wxString& name = wxGLCanvasName, const wxPalette& palette = wxNullPalette); - wxEXPLICIT // avoid implicitly converting a wxWindow* to wxGLCanvas + explicit // avoid implicitly converting a wxWindow* to wxGLCanvas wxGLCanvas(wxWindow *parent, wxWindowID id = wxID_ANY, const int *attribList = NULL, diff --git a/include/wx/gtk/private/textmeasure.h b/include/wx/gtk/private/textmeasure.h index d27b096f26..4620df08a0 100644 --- a/include/wx/gtk/private/textmeasure.h +++ b/include/wx/gtk/private/textmeasure.h @@ -19,13 +19,13 @@ class WXDLLIMPEXP_FWD_CORE wxWindowDCImpl; class wxTextMeasure : public wxTextMeasureBase { public: - wxEXPLICIT wxTextMeasure(const wxDC *dc, const wxFont *font = NULL) + explicit wxTextMeasure(const wxDC *dc, const wxFont *font = NULL) : wxTextMeasureBase(dc, font) { Init(); } - wxEXPLICIT wxTextMeasure(const wxWindow *win, const wxFont *font = NULL) + explicit wxTextMeasure(const wxWindow *win, const wxFont *font = NULL) : wxTextMeasureBase(win, font) { Init(); diff --git a/include/wx/gtk1/glcanvas.h b/include/wx/gtk1/glcanvas.h index 446344b860..73dcb27b59 100644 --- a/include/wx/gtk1/glcanvas.h +++ b/include/wx/gtk1/glcanvas.h @@ -29,7 +29,7 @@ public: const wxString& name = wxGLCanvasName, const wxPalette& palette = wxNullPalette); - wxEXPLICIT // avoid implicitly converting a wxWindow* to wxGLCanvas + explicit // avoid implicitly converting a wxWindow* to wxGLCanvas wxGLCanvas(wxWindow *parent, wxWindowID id = wxID_ANY, const int *attribList = NULL, diff --git a/include/wx/hashmap.h b/include/wx/hashmap.h index 121a1febdc..371407e5a9 100644 --- a/include/wx/hashmap.h +++ b/include/wx/hashmap.h @@ -640,8 +640,8 @@ public: \ typedef VALUE_T mapped_type; \ _WX_DECLARE_PAIR( iterator, bool, Insert_Result, CLASSEXP ) \ \ - wxEXPLICIT CLASSNAME( size_type hint = 100, hasher hf = hasher(), \ - key_equal eq = key_equal() ) \ + explicit CLASSNAME( size_type hint = 100, hasher hf = hasher(), \ + key_equal eq = key_equal() ) \ : CLASSNAME##_wxImplementation_HashTable( hint, hf, eq, \ CLASSNAME##_wxImplementation_KeyEx() ) {} \ \ diff --git a/include/wx/hashset.h b/include/wx/hashset.h index 8cd1becf9b..38a65ab5f4 100644 --- a/include/wx/hashset.h +++ b/include/wx/hashset.h @@ -123,8 +123,8 @@ CLASSEXP CLASSNAME:public CLASSNAME##_wxImplementation_HashTable \ public: \ _WX_DECLARE_PAIR( iterator, bool, Insert_Result, CLASSEXP ) \ \ - wxEXPLICIT CLASSNAME( size_type hint = 100, hasher hf = hasher(), \ - key_equal eq = key_equal() ) \ + explicit CLASSNAME( size_type hint = 100, hasher hf = hasher(), \ + key_equal eq = key_equal() ) \ : CLASSNAME##_wxImplementation_HashTable( hint, hf, eq, \ CLASSNAME##_wxImplementation_KeyEx() ) {} \ \ diff --git a/include/wx/iconloc.h b/include/wx/iconloc.h index 9baaaa5297..bce75aa83e 100644 --- a/include/wx/iconloc.h +++ b/include/wx/iconloc.h @@ -21,7 +21,7 @@ class WXDLLIMPEXP_BASE wxIconLocationBase { public: // ctor takes the name of the file where the icon is - wxEXPLICIT wxIconLocationBase(const wxString& filename = wxEmptyString) + explicit wxIconLocationBase(const wxString& filename = wxEmptyString) : m_filename(filename) { } // default copy ctor, assignment operator and dtor are ok @@ -47,7 +47,7 @@ class WXDLLIMPEXP_BASE wxIconLocation : public wxIconLocationBase public: // ctor takes the name of the file where the icon is and the icons index in // the file - wxEXPLICIT wxIconLocation(const wxString& file = wxEmptyString, int num = 0); + explicit wxIconLocation(const wxString& file = wxEmptyString, int num = 0); // set/get the icon index void SetIndex(int num) { m_index = num; } @@ -70,7 +70,7 @@ wxIconLocation::wxIconLocation(const wxString& file, int num) class WXDLLIMPEXP_BASE wxIconLocation : public wxIconLocationBase { public: - wxEXPLICIT wxIconLocation(const wxString& filename = wxEmptyString) + explicit wxIconLocation(const wxString& filename = wxEmptyString) : wxIconLocationBase(filename) { } }; diff --git a/include/wx/list.h b/include/wx/list.h index 9278a4f148..4644c22c3b 100644 --- a/include/wx/list.h +++ b/include/wx/list.h @@ -942,7 +942,7 @@ private: { return it.m_node == m_node; } \ }; \ \ - wxEXPLICIT name(size_type n, const_reference v = value_type()) \ + explicit name(size_type n, const_reference v = value_type()) \ { assign(n, v); } \ name(const const_iterator& first, const const_iterator& last) \ { assign(first, last); } \ diff --git a/include/wx/modalhook.h b/include/wx/modalhook.h index 55341f9bd9..a60b77e389 100644 --- a/include/wx/modalhook.h +++ b/include/wx/modalhook.h @@ -77,7 +77,7 @@ private: class wxModalDialogHookExitGuard { public: - wxEXPLICIT wxModalDialogHookExitGuard(wxDialog* dialog) + explicit wxModalDialogHookExitGuard(wxDialog* dialog) : m_dialog(dialog) { } diff --git a/include/wx/msw/bitmap.h b/include/wx/msw/bitmap.h index 4ebc108894..4fbc62f7dc 100644 --- a/include/wx/msw/bitmap.h +++ b/include/wx/msw/bitmap.h @@ -98,7 +98,7 @@ public: } // Convert from wxCursor - wxEXPLICIT wxBitmap(const wxCursor& cursor) + explicit wxBitmap(const wxCursor& cursor) { (void)CopyFromCursor(cursor, wxBitmapTransparency_Auto); } diff --git a/include/wx/msw/enhmeta.h b/include/wx/msw/enhmeta.h index b3ae3bb4c6..b501b2d752 100644 --- a/include/wx/msw/enhmeta.h +++ b/include/wx/msw/enhmeta.h @@ -96,7 +96,7 @@ public: // as above, but takes reference DC as first argument to take resolution, // size, font metrics etc. from - wxEXPLICIT + explicit wxEnhMetaFileDC(const wxDC& referenceDC, const wxString& filename = wxEmptyString, int width = 0, int height = 0, diff --git a/include/wx/msw/glcanvas.h b/include/wx/msw/glcanvas.h index fdcdd1faa5..0e05c01e35 100644 --- a/include/wx/msw/glcanvas.h +++ b/include/wx/msw/glcanvas.h @@ -47,7 +47,7 @@ private: class WXDLLIMPEXP_GL wxGLCanvas : public wxGLCanvasBase { public: - wxEXPLICIT // avoid implicitly converting a wxWindow* to wxGLCanvas + explicit // avoid implicitly converting a wxWindow* to wxGLCanvas wxGLCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs, wxWindowID id = wxID_ANY, @@ -57,7 +57,7 @@ public: const wxString& name = wxGLCanvasName, const wxPalette& palette = wxNullPalette); - wxEXPLICIT + explicit wxGLCanvas(wxWindow *parent, wxWindowID id = wxID_ANY, const int *attribList = NULL, diff --git a/include/wx/msw/ole/oleutils.h b/include/wx/msw/ole/oleutils.h index 57a99fb445..befb693189 100644 --- a/include/wx/msw/ole/oleutils.h +++ b/include/wx/msw/ole/oleutils.h @@ -285,7 +285,7 @@ private: class WXDLLIMPEXP_CORE wxVariantDataSafeArray : public wxVariantData { public: - wxEXPLICIT wxVariantDataSafeArray(SAFEARRAY* value = NULL) + explicit wxVariantDataSafeArray(SAFEARRAY* value = NULL) { m_value = value; } diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h index 6af753ff27..1abdbaa4e8 100644 --- a/include/wx/msw/private.h +++ b/include/wx/msw/private.h @@ -157,7 +157,7 @@ template class AutoHANDLE { public: - wxEXPLICIT AutoHANDLE(HANDLE handle = InvalidHandle()) : m_handle(handle) { } + explicit AutoHANDLE(HANDLE handle = InvalidHandle()) : m_handle(handle) { } bool IsOk() const { return m_handle != InvalidHandle(); } operator HANDLE() const { return m_handle; } diff --git a/include/wx/msw/private/comptr.h b/include/wx/msw/private/comptr.h index 194cf54f90..2b21cfa82e 100644 --- a/include/wx/msw/private/comptr.h +++ b/include/wx/msw/private/comptr.h @@ -25,7 +25,7 @@ public: { } - wxEXPLICIT wxCOMPtr(T* ptr) + explicit wxCOMPtr(T* ptr) : m_ptr(ptr) { if ( m_ptr ) diff --git a/include/wx/msw/private/pipestream.h b/include/wx/msw/private/pipestream.h index ba6d032bea..23df2b8943 100644 --- a/include/wx/msw/private/pipestream.h +++ b/include/wx/msw/private/pipestream.h @@ -13,7 +13,7 @@ class wxPipeInputStream : public wxInputStream { public: - wxEXPLICIT wxPipeInputStream(HANDLE hInput); + explicit wxPipeInputStream(HANDLE hInput); virtual ~wxPipeInputStream(); // returns true if the pipe is still opened @@ -34,7 +34,7 @@ protected: class wxPipeOutputStream: public wxOutputStream { public: - wxEXPLICIT wxPipeOutputStream(HANDLE hOutput); + explicit wxPipeOutputStream(HANDLE hOutput); virtual ~wxPipeOutputStream() { Close(); } bool Close(); diff --git a/include/wx/msw/private/textmeasure.h b/include/wx/msw/private/textmeasure.h index ee14751a5b..2c890a9fad 100644 --- a/include/wx/msw/private/textmeasure.h +++ b/include/wx/msw/private/textmeasure.h @@ -19,13 +19,13 @@ class wxTextMeasure : public wxTextMeasureBase { public: - wxEXPLICIT wxTextMeasure(const wxDC *dc, const wxFont *font = NULL) + explicit wxTextMeasure(const wxDC *dc, const wxFont *font = NULL) : wxTextMeasureBase(dc, font) { Init(); } - wxEXPLICIT wxTextMeasure(const wxWindow *win, const wxFont *font = NULL) + explicit wxTextMeasure(const wxWindow *win, const wxFont *font = NULL) : wxTextMeasureBase(win, font) { Init(); diff --git a/include/wx/object.h b/include/wx/object.h index 6a0140737b..1dd57cd654 100644 --- a/include/wx/object.h +++ b/include/wx/object.h @@ -268,7 +268,7 @@ class wxObjectDataPtr public: typedef T element_type; - wxEXPLICIT wxObjectDataPtr(T *ptr = NULL) : m_ptr(ptr) {} + explicit wxObjectDataPtr(T *ptr = NULL) : m_ptr(ptr) {} // copy ctor wxObjectDataPtr(const wxObjectDataPtr &tocopy) diff --git a/include/wx/private/addremovectrl.h b/include/wx/private/addremovectrl.h index adb349f646..19540e8df1 100644 --- a/include/wx/private/addremovectrl.h +++ b/include/wx/private/addremovectrl.h @@ -24,9 +24,9 @@ public: // class is supposed to create the buttons and layout everything. // // Takes ownership of the adaptor pointer. - wxEXPLICIT wxAddRemoveImplBase(wxAddRemoveAdaptor* adaptor, - wxAddRemoveCtrl* WXUNUSED(parent), - wxWindow* ctrlItems) + explicit wxAddRemoveImplBase(wxAddRemoveAdaptor* adaptor, + wxAddRemoveCtrl* WXUNUSED(parent), + wxWindow* ctrlItems) : m_adaptor(adaptor) { ctrlItems->Bind(wxEVT_CHAR, &wxAddRemoveImplBase::OnChar, this); @@ -105,9 +105,9 @@ private: class wxAddRemoveImplWithButtons : public wxAddRemoveImplBase { public: - wxEXPLICIT wxAddRemoveImplWithButtons(wxAddRemoveAdaptor* adaptor, - wxAddRemoveCtrl* parent, - wxWindow* ctrlItems) + explicit wxAddRemoveImplWithButtons(wxAddRemoveAdaptor* adaptor, + wxAddRemoveCtrl* parent, + wxWindow* ctrlItems) : wxAddRemoveImplBase(adaptor, parent, ctrlItems) { m_btnAdd = diff --git a/include/wx/private/fdioeventloopsourcehandler.h b/include/wx/private/fdioeventloopsourcehandler.h index 5ac17de240..fcf67622bf 100644 --- a/include/wx/private/fdioeventloopsourcehandler.h +++ b/include/wx/private/fdioeventloopsourcehandler.h @@ -19,7 +19,7 @@ class wxFDIOEventLoopSourceHandler : public wxFDIOHandler { public: - wxEXPLICIT wxFDIOEventLoopSourceHandler(wxEventLoopSourceHandler* handler) + explicit wxFDIOEventLoopSourceHandler(wxEventLoopSourceHandler* handler) : m_handler(handler) { } diff --git a/include/wx/qt/bitmap.h b/include/wx/qt/bitmap.h index b804551bf6..aee92f648b 100644 --- a/include/wx/qt/bitmap.h +++ b/include/wx/qt/bitmap.h @@ -32,7 +32,7 @@ public: // Convert from wxIcon / wxCursor wxBitmap(const wxIcon& icon) { CopyFromIcon(icon); } - wxEXPLICIT wxBitmap(const wxCursor& cursor); + explicit wxBitmap(const wxCursor& cursor); static void InitStandardHandlers(); diff --git a/include/wx/qt/glcanvas.h b/include/wx/qt/glcanvas.h index 73c5b54957..13cce8a2ea 100644 --- a/include/wx/qt/glcanvas.h +++ b/include/wx/qt/glcanvas.h @@ -31,7 +31,7 @@ private: class WXDLLIMPEXP_GL wxGLCanvas : public wxGLCanvasBase { public: - wxEXPLICIT // avoid implicitly converting a wxWindow* to wxGLCanvas + explicit // avoid implicitly converting a wxWindow* to wxGLCanvas wxGLCanvas(wxWindow *parent, wxWindowID id = wxID_ANY, const int *attribList = NULL, diff --git a/include/wx/scopedarray.h b/include/wx/scopedarray.h index 2f80911fa2..02455d7385 100644 --- a/include/wx/scopedarray.h +++ b/include/wx/scopedarray.h @@ -24,8 +24,8 @@ class wxScopedArray public: typedef T element_type; - wxEXPLICIT wxScopedArray(T * array = NULL) : m_array(array) { } - wxEXPLICIT wxScopedArray(size_t count) : m_array(new T[count]) { } + explicit wxScopedArray(T * array = NULL) : m_array(array) { } + explicit wxScopedArray(size_t count) : m_array(new T[count]) { } ~wxScopedArray() { delete [] m_array; } @@ -77,7 +77,7 @@ private: \ name & operator=(name const &); \ \ public: \ - wxEXPLICIT name(T * p = NULL) : m_ptr(p) \ + explicit name(T * p = NULL) : m_ptr(p) \ {} \ \ ~name(); \ diff --git a/include/wx/scopedptr.h b/include/wx/scopedptr.h index ea83299fec..784e99d00e 100644 --- a/include/wx/scopedptr.h +++ b/include/wx/scopedptr.h @@ -40,7 +40,7 @@ class wxScopedPtr public: typedef T element_type; - wxEXPLICIT wxScopedPtr(T * ptr = NULL) : m_ptr(ptr) { } + explicit wxScopedPtr(T * ptr = NULL) : m_ptr(ptr) { } ~wxScopedPtr() { wxCHECKED_DELETE(m_ptr); } @@ -123,7 +123,7 @@ private: \ name & operator=(name const &); \ \ public: \ - wxEXPLICIT name(T * ptr = NULL) \ + explicit name(T * ptr = NULL) \ : m_ptr(ptr) { } \ \ ~name(); \ diff --git a/include/wx/scrolwin.h b/include/wx/scrolwin.h index e8f4ac8386..3c4a870aca 100644 --- a/include/wx/scrolwin.h +++ b/include/wx/scrolwin.h @@ -64,7 +64,7 @@ enum wxScrollbarVisibility class WXDLLIMPEXP_CORE wxAnyScrollHelperBase { public: - wxEXPLICIT wxAnyScrollHelperBase(wxWindow* win); + explicit wxAnyScrollHelperBase(wxWindow* win); virtual ~wxAnyScrollHelperBase() {} // Disable use of keyboard keys for scrolling. By default cursor movement diff --git a/include/wx/sharedptr.h b/include/wx/sharedptr.h index a9b6442c09..67618c2b1b 100644 --- a/include/wx/sharedptr.h +++ b/include/wx/sharedptr.h @@ -23,7 +23,7 @@ class wxSharedPtr public: typedef T element_type; - wxEXPLICIT wxSharedPtr( T* ptr = NULL ) + explicit wxSharedPtr( T* ptr = NULL ) : m_ref(NULL) { if (ptr) @@ -31,7 +31,7 @@ public: } template - wxEXPLICIT wxSharedPtr(T* ptr, Deleter d) + explicit wxSharedPtr(T* ptr, Deleter d) : m_ref(NULL) { if (ptr) diff --git a/include/wx/unix/private/pipestream.h b/include/wx/unix/private/pipestream.h index 313a271741..2fa44e0062 100644 --- a/include/wx/unix/private/pipestream.h +++ b/include/wx/unix/private/pipestream.h @@ -15,7 +15,7 @@ class wxPipeInputStream : public wxFileInputStream { public: - wxEXPLICIT wxPipeInputStream(int fd) : wxFileInputStream(fd) { } + explicit wxPipeInputStream(int fd) : wxFileInputStream(fd) { } // return true if the pipe is still opened bool IsOpened() const { return !Eof(); } diff --git a/include/wx/vector.h b/include/wx/vector.h index 4eb0f856f4..686dc0a587 100644 --- a/include/wx/vector.h +++ b/include/wx/vector.h @@ -145,7 +145,7 @@ public: { public: reverse_iterator() : m_ptr(NULL) { } - wxEXPLICIT reverse_iterator(iterator it) : m_ptr(it) { } + explicit reverse_iterator(iterator it) : m_ptr(it) { } reverse_iterator(const reverse_iterator& it) : m_ptr(it.m_ptr) { } reference operator*() const { return *m_ptr; } @@ -189,7 +189,7 @@ public: { public: const_reverse_iterator() : m_ptr(NULL) { } - wxEXPLICIT const_reverse_iterator(const_iterator it) : m_ptr(it) { } + explicit const_reverse_iterator(const_iterator it) : m_ptr(it) { } const_reverse_iterator(const reverse_iterator& it) : m_ptr(it.m_ptr) { } const_reverse_iterator(const const_reverse_iterator& it) : m_ptr(it.m_ptr) { } diff --git a/include/wx/window.h b/include/wx/window.h index c5bac6248f..ca168dd6fd 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -581,7 +581,7 @@ public: public: // Notice that window can be NULL here, for convenience. In this case // this class simply doesn't do anything. - wxEXPLICIT ChildrenRepositioningGuard(wxWindowBase* win) + explicit ChildrenRepositioningGuard(wxWindowBase* win) : m_win(win), m_callEnd(win && win->BeginRepositioningChildren()) { diff --git a/include/wx/windowptr.h b/include/wx/windowptr.h index bebcf6ad8f..b4ac928068 100644 --- a/include/wx/windowptr.h +++ b/include/wx/windowptr.h @@ -35,7 +35,7 @@ class wxWindowPtr : public wxSharedPtr public: typedef T element_type; - wxEXPLICIT wxWindowPtr(element_type* win) + explicit wxWindowPtr(element_type* win) : wxSharedPtr(win, wxPrivate::wxWindowDeleter()) { } diff --git a/include/wx/x11/glcanvas.h b/include/wx/x11/glcanvas.h index a02e0ba4b9..d6bfe79da7 100644 --- a/include/wx/x11/glcanvas.h +++ b/include/wx/x11/glcanvas.h @@ -26,7 +26,7 @@ public: const wxString& name = wxGLCanvasName, const wxPalette& palette = wxNullPalette); - wxEXPLICIT // avoid implicitly converting a wxWindow* to wxGLCanvas + explicit // avoid implicitly converting a wxWindow* to wxGLCanvas wxGLCanvas(wxWindow *parent, wxWindowID id = wxID_ANY, const int *attribList = NULL, diff --git a/interface/wx/defs.h b/interface/wx/defs.h index 37e226bedc..7d4a954270 100644 --- a/interface/wx/defs.h +++ b/interface/wx/defs.h @@ -1699,17 +1699,6 @@ template wxDELETEA(T*& array); */ #define wxDEPRECATED_BUT_USED_INTERNALLY_INLINE(func, body) -/** - @c wxEXPLICIT is a macro which expands to the C++ @c explicit keyword if - the compiler supports it or nothing otherwise. Thus, it can be used even in - the code which might have to be compiled with an old compiler without - support for this language feature but still take advantage of it when it is - available. - - @header{wx/defs.h} -*/ -#define wxEXPLICIT - /** @c wxOVERRIDE expands to the C++11 @c override keyword if it's supported by the compiler or nothing otherwise. diff --git a/interface/wx/sharedptr.h b/interface/wx/sharedptr.h index 8b7087baed..52900275a4 100644 --- a/interface/wx/sharedptr.h +++ b/interface/wx/sharedptr.h @@ -26,7 +26,7 @@ public: Creates shared pointer from the raw pointer @a ptr and takes ownership of it. */ - wxEXPLICIT wxSharedPtr(T* ptr = NULL); + explicit wxSharedPtr(T* ptr = NULL); /** Constructor. @@ -42,7 +42,7 @@ public: @since 3.0 */ template - wxEXPLICIT wxSharedPtr(T* ptr, Deleter d); + explicit wxSharedPtr(T* ptr, Deleter d); /** Copy constructor. diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index 23e7e5c4d9..7ddc6701a5 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -1368,7 +1368,7 @@ void MyFrame::AddRemove(wxCommandEvent& WXUNUSED(event)) class ListBoxAdaptor : public wxAddRemoveAdaptor { public: - wxEXPLICIT ListBoxAdaptor(wxListBox* lbox) + explicit ListBoxAdaptor(wxListBox* lbox) : m_lbox(lbox) { } diff --git a/src/common/init.cpp b/src/common/init.cpp index 7e47e6007b..5a3b521d0f 100644 --- a/src/common/init.cpp +++ b/src/common/init.cpp @@ -82,7 +82,7 @@ wxDEFINE_SCOPED_PTR(wxAppConsole, wxAppPtrBase) class wxAppPtr : public wxAppPtrBase { public: - wxEXPLICIT wxAppPtr(wxAppConsole *ptr = NULL) : wxAppPtrBase(ptr) { } + explicit wxAppPtr(wxAppConsole *ptr = NULL) : wxAppPtrBase(ptr) { } ~wxAppPtr() { if ( get() ) diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index d9f52733c7..67f2933a17 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -2022,7 +2022,7 @@ namespace class ValidationTraverserBase { public: - wxEXPLICIT ValidationTraverserBase(wxWindowBase* win) + explicit ValidationTraverserBase(wxWindowBase* win) : m_win(static_cast(win)) { } @@ -2084,7 +2084,7 @@ bool wxWindowBase::Validate() class ValidateTraverser : public ValidationTraverserBase { public: - wxEXPLICIT ValidateTraverser(wxWindowBase* win) + explicit ValidateTraverser(wxWindowBase* win) : ValidationTraverserBase(win) { } @@ -2112,7 +2112,7 @@ bool wxWindowBase::TransferDataToWindow() class DataToWindowTraverser : public ValidationTraverserBase { public: - wxEXPLICIT DataToWindowTraverser(wxWindowBase* win) + explicit DataToWindowTraverser(wxWindowBase* win) : ValidationTraverserBase(win) { } diff --git a/src/gtk/spinctrl.cpp b/src/gtk/spinctrl.cpp index b33593cf59..5a22d6fbe4 100644 --- a/src/gtk/spinctrl.cpp +++ b/src/gtk/spinctrl.cpp @@ -83,7 +83,7 @@ gtk_changed(GtkSpinButton* spinbutton, wxSpinCtrl* win) class wxSpinCtrlEventDisabler { public: - wxEXPLICIT wxSpinCtrlEventDisabler(wxSpinCtrlGTKBase* spin) + explicit wxSpinCtrlEventDisabler(wxSpinCtrlGTKBase* spin) : m_spin(spin) { m_spin->GtkDisableEvents(); diff --git a/src/ribbon/bar.cpp b/src/ribbon/bar.cpp index 3592078144..304f92c7c0 100644 --- a/src/ribbon/bar.cpp +++ b/src/ribbon/bar.cpp @@ -490,7 +490,7 @@ void wxRibbonBar::SetTabCtrlMargins(int left, int right) struct PageComparedBySmallWidthAsc { - wxEXPLICIT PageComparedBySmallWidthAsc(wxRibbonPageTabInfo* page) + explicit PageComparedBySmallWidthAsc(wxRibbonPageTabInfo* page) : m_page(page) { } diff --git a/tests/exec/exec.cpp b/tests/exec/exec.cpp index d102b43d6d..ca77c08783 100644 --- a/tests/exec/exec.cpp +++ b/tests/exec/exec.cpp @@ -302,7 +302,7 @@ void ExecTestCase::TestProcess() class TestAsyncProcess : public wxProcess { public: - wxEXPLICIT TestAsyncProcess() + explicit TestAsyncProcess() { }