changeset 31836:2bf580e9f423

new macros for disabling class copy and move member functions * oct-conf-post-public.in.h (OCTAVE_DISABLE_COPY, OCTAVE_DISABLE_MOVE, OCTAVE_DISABLE_COPY_MOVE): New macros.
author John W. Eaton <jwe@octave.org>
date Thu, 16 Feb 2023 08:55:58 -0500
parents 80eff88db003
children febd82d1a8de
files oct-conf-post-public.in.h
diffstat 1 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/oct-conf-post-public.in.h	Thu Feb 16 08:00:45 2023 -0800
+++ b/oct-conf-post-public.in.h	Thu Feb 16 08:55:58 2023 -0500
@@ -320,6 +320,20 @@
 #  define OCTAVE_THREAD_LOCAL
 #endif
 
+#if defined (__cplusplus)
+#  define OCTAVE_DISABLE_COPY(X)                \
+  X (const X&) = delete;                        \
+  X& operator = (const X&) = delete;
+
+#  define OCTAVE_DISABLE_MOVE(X)                \
+  X (const X&&) = delete;                       \
+  X& operator = (const X&&) = delete;
+
+#  define OCTAVE_DISABLE_COPY_MOVE(X)           \
+  OCTAVE_DISABLE_COPY (X)                       \
+  OCTAVE_DISABLE_MOVE (X)
+#endif
+
 typedef OCTAVE_IDX_TYPE octave_idx_type;
 typedef OCTAVE_F77_INT_TYPE octave_f77_int_type;