Replace wxEXPLICIT with the 'explicit' keyword

See #17655.
This commit is contained in:
ARATA Mizuki
2016-08-30 17:44:32 +09:00
parent 1e6251d592
commit 8cfc74491a
46 changed files with 73 additions and 99 deletions

View File

@@ -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; }
};

View File

@@ -87,7 +87,7 @@ class wxDataViewItem : public wxItemId<void*>
{
public:
wxDataViewItem() : wxItemId<void*>() { }
wxEXPLICIT wxDataViewItem(void* pItem) : wxItemId<void*>(pItem) { }
explicit wxDataViewItem(void* pItem) : wxItemId<void*>(pItem) { }
};
WX_DEFINE_ARRAY(wxDataViewItem, wxDataViewItemArray);

View File

@@ -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

View File

@@ -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); }

View File

@@ -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

View File

@@ -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,

View File

@@ -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:

View File

@@ -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;

View File

@@ -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,

View File

@@ -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();

View File

@@ -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,

View File

@@ -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() ) {} \
\

View File

@@ -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() ) {} \
\

View File

@@ -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) { }
};

View File

@@ -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); } \

View File

@@ -77,7 +77,7 @@ private:
class wxModalDialogHookExitGuard
{
public:
wxEXPLICIT wxModalDialogHookExitGuard(wxDialog* dialog)
explicit wxModalDialogHookExitGuard(wxDialog* dialog)
: m_dialog(dialog)
{
}

View File

@@ -98,7 +98,7 @@ public:
}
// Convert from wxCursor
wxEXPLICIT wxBitmap(const wxCursor& cursor)
explicit wxBitmap(const wxCursor& cursor)
{
(void)CopyFromCursor(cursor, wxBitmapTransparency_Auto);
}

View File

@@ -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,

View File

@@ -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,

View File

@@ -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;
}

View File

@@ -157,7 +157,7 @@ template <wxUIntPtr INVALID_VALUE = (wxUIntPtr)INVALID_HANDLE_VALUE>
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; }

View File

@@ -25,7 +25,7 @@ public:
{
}
wxEXPLICIT wxCOMPtr(T* ptr)
explicit wxCOMPtr(T* ptr)
: m_ptr(ptr)
{
if ( m_ptr )

View File

@@ -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();

View File

@@ -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();

View File

@@ -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<T> &tocopy)

View File

@@ -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 =

View File

@@ -19,7 +19,7 @@
class wxFDIOEventLoopSourceHandler : public wxFDIOHandler
{
public:
wxEXPLICIT wxFDIOEventLoopSourceHandler(wxEventLoopSourceHandler* handler)
explicit wxFDIOEventLoopSourceHandler(wxEventLoopSourceHandler* handler)
: m_handler(handler)
{
}

View File

@@ -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();

View File

@@ -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,

View File

@@ -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(); \

View File

@@ -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(); \

View File

@@ -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

View File

@@ -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<typename Deleter>
wxEXPLICIT wxSharedPtr(T* ptr, Deleter d)
explicit wxSharedPtr(T* ptr, Deleter d)
: m_ref(NULL)
{
if (ptr)

View File

@@ -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(); }

View File

@@ -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) { }

View File

@@ -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())
{

View File

@@ -35,7 +35,7 @@ class wxWindowPtr : public wxSharedPtr<T>
public:
typedef T element_type;
wxEXPLICIT wxWindowPtr(element_type* win)
explicit wxWindowPtr(element_type* win)
: wxSharedPtr<T>(win, wxPrivate::wxWindowDeleter())
{
}

View File

@@ -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,