Merge branch 'clean-up-pre-c++98-compatibility-macro' of https://github.com/minoki/wxWidgets

Don't bother with checking for some really obsolete compilers and just assume
that C++98 keywords "explicit", "{static,const,dynamic}_cast" and support for
partial template specialization is always available.

Closes #17655.
This commit is contained in:
Vadim Zeitlin
2016-09-16 01:41:19 +02:00
58 changed files with 85 additions and 316 deletions

View File

@@ -1699,17 +1699,6 @@ template <typename T> 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.

View File

@@ -789,39 +789,6 @@ public:
*/
#define wxIMPLEMENT_CLASS2( className, baseClassName1, baseClassName2 )
/**
Same as @c const_cast<T>(x) if the compiler supports const cast or @c (T)x for
old compilers. Unlike wxConstCast(), the cast it to the type @c T and not to
<tt>T *</tt> and also the order of arguments is the same as for the standard cast.
@header{wx/defs.h}
@see wx_reinterpret_cast(), wx_static_cast()
*/
#define wx_const_cast(T, x)
/**
Same as @c reinterpret_cast<T>(x) if the compiler supports reinterpret cast or
@c (T)x for old compilers.
@header{wx/defs.h}
@see wx_const_cast(), wx_static_cast()
*/
#define wx_reinterpret_cast(T, x)
/**
Same as @c static_cast<T>(x) if the compiler supports static cast or @c (T)x for
old compilers. Unlike wxStaticCast(), there are no checks being done and
the meaning of the macro arguments is exactly the same as for the standard
static cast, i.e. @a T is the full type name and star is not appended to it.
@header{wx/defs.h}
@see wx_const_cast(), wx_reinterpret_cast(), wx_truncate_cast()
*/
#define wx_static_cast(T, x)
/**
This case doesnt correspond to any standard cast but exists solely to make
casts which possibly result in a truncation of an integer value more
@@ -837,7 +804,7 @@ public:
@header{wx/defs.h}
@see wx_const_cast(), wxDynamicCast(), wxStaticCast()
@see wxDynamicCast(), wxStaticCast()
*/
#define wxConstCast( ptr, classname )
@@ -889,7 +856,7 @@ public:
@header{wx/object.h}
@see wx_static_cast(), wxDynamicCast(), wxConstCast()
@see wxDynamicCast(), wxConstCast()
*/
#define wxStaticCast( ptr, classname )

View File

@@ -89,7 +89,7 @@ public:
// wxMSW is one of the platforms where the generic implementation
// of wxFilePickerCtrl is used...
wxButton *pButt = wx_static_cast(wxButton*, myFilePickerCtrl->GetPickerCtrl());
wxButton *pButt = static_cast<wxButton*>(myFilePickerCtrl->GetPickerCtrl());
if (pButt)
pButt->SetLabel("Custom browse string");
#endif

View File

@@ -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<typename Deleter>
wxEXPLICIT wxSharedPtr(T* ptr, Deleter d);
explicit wxSharedPtr(T* ptr, Deleter d);
/**
Copy constructor.