mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-20 21:08:24 +08:00
Add wxDECLARE_DEFAULT_COPY[_AND_DEF]() for 3.2 compatibility
These macros are not used in this version, but define them just in case
people use them in their own code (they shouldn't, but they probably
will) when using wx 3.2 where they have been added in 5c249cbca9
(Explicitly define copy ctors etc in classes with virtual dtors,
2024-04-25).
See #24502.
This commit is contained in:
@@ -3042,11 +3042,25 @@ typedef const void* WXWidget;
|
||||
/* macros to define a class without copy ctor nor assignment operator */
|
||||
/* --------------------------------------------------------------------------- */
|
||||
|
||||
/* Obsolete macros kept only for compatibility, just use the corresponding
|
||||
C++11 keywords directly in the class definition when writing new code. */
|
||||
#define wxMEMBER_DELETE = delete
|
||||
|
||||
/* Also note that these macro do _not_ require a semicolon after them for
|
||||
compatibility with wxWidgets 3.2. */
|
||||
#define wxDECLARE_DEFAULT_COPY_CTOR(classname) \
|
||||
public: \
|
||||
classname(const classname&) = default;
|
||||
|
||||
#define wxDECLARE_DEFAULT_COPY(classname) \
|
||||
wxDECLARE_DEFAULT_COPY_CTOR(classname) \
|
||||
classname& operator=(const classname&) = default;
|
||||
|
||||
#define wxDECLARE_DEFAULT_COPY_AND_DEF(classname) \
|
||||
classname() = default; \
|
||||
wxDECLARE_DEFAULT_COPY(classname);
|
||||
|
||||
/* These macros do require a semicolon after them. */
|
||||
#define wxDECLARE_NO_COPY_CLASS(classname) \
|
||||
private: \
|
||||
classname(const classname&) wxMEMBER_DELETE; \
|
||||
|
||||
Reference in New Issue
Block a user