diff liboctave/array/idx-vector.h @ 22869:f75d289645ec

make deleted functions public * octave-gui.h, resource-manager.h, shortcut-manager.h, base-text-renderer.h, c-file-ptr-stream.h, dynamic-ld.cc, dynamic-ld.h, event-queue.h, ft-text-renderer.cc, gl-render.cc, gl-render.h, graphics.cc, graphics.in.h, interpreter.h, mex.cc, mxarray.in.h, oct-fstrm.h, oct-iostrm.h, oct-prcstrm.h, oct-procbuf.h, oct-stdstrm.h, oct-stream.cc, oct-stream.h, oct-strstrm.h, octave-link.h, pager.h, profiler.h, sighandlers.cc, symtab.h, text-renderer.h, zfstream.h, __init_fltk__.cc, ov-builtin.h, ov-dld-fcn.h, ov-fcn.h, ov-mex-fcn.h, ov-typeinfo.h, ov-usr-fcn.h, octave.h, lex.h, parse.h, pt-arg-list.h, pt-array-list.h, pt-assign.h, pt-binop.h, pt-bp.h, pt-cell.h, pt-check.h, pt-classdef.h, pt-cmd.h, pt-colon.h, pt-const.h, pt-decl.h, pt-eval.h, pt-except.h, pt-exp.h, pt-fcn-handle.h, pt-funcall.h, pt-id.h, pt-idx.h, pt-jump.h, pt-loop.h, pt-mat.h, pt-misc.h, pt-pr-code.h, pt-select.h, pt-stmt.h, pt-unop.h, pt-walk.h, pt.h, token.h, Array.cc, idx-vector.h, oct-fftw.h, sparse-chol.cc, sparse-qr.cc, file-ops.h, mach-info.h, oct-env.h, action-container.h, cmd-edit.cc, cmd-edit.h, cmd-hist.h, oct-locbuf.h, oct-mutex.h, oct-shlib.cc, oct-sort.h, pathsearch.h, singleton-cleanup.h, unwind-prot.h, url-transfer.cc, url-transfer.h: Declare deleted copy constructors and assignment operators public.
author John W. Eaton <jwe@octave.org>
date Tue, 06 Dec 2016 12:40:45 -0500
parents 87e3163f6c87
children 27e4ec3b0b49
line wrap: on
line diff
--- a/liboctave/array/idx-vector.h	Tue Dec 06 10:59:29 2016 -0500
+++ b/liboctave/array/idx-vector.h	Tue Dec 06 12:40:45 2016 -0500
@@ -74,6 +74,12 @@
   public:
     idx_base_rep (void) : count (1), err (false) { }
 
+    // No copying!
+
+    idx_base_rep (const idx_base_rep&) = delete;
+
+    idx_base_rep& operator = (const idx_base_rep&) = delete;
+
     virtual ~idx_base_rep (void) = default;
 
     // Non-range-checking element query.
@@ -110,14 +116,6 @@
     octave_refcount<int> count;
 
     bool err;
-
-  private:
-
-    // No copying!
-
-    idx_base_rep (const idx_base_rep&) = delete;
-
-    idx_base_rep& operator = (const idx_base_rep&) = delete;
   };
 
   // The magic colon index.
@@ -128,6 +126,12 @@
 
     idx_colon_rep (char c);
 
+    // No copying!
+
+    idx_colon_rep (const idx_colon_rep& idx) = delete;
+
+    idx_colon_rep& operator = (const idx_colon_rep& idx) = delete;
+
     octave_idx_type xelem (octave_idx_type i) const { return i; }
 
     octave_idx_type checkelem (octave_idx_type i) const;
@@ -146,14 +150,6 @@
     bool is_colon_equiv (octave_idx_type) const { return true; }
 
     std::ostream& print (std::ostream& os) const;
-
-  private:
-
-    // No copying!
-
-    idx_colon_rep (const idx_colon_rep& idx) = delete;
-
-    idx_colon_rep& operator = (const idx_colon_rep& idx) = delete;
   };
 
   // To distinguish the "direct" constructors that blindly trust the data.
@@ -163,12 +159,18 @@
   class OCTAVE_API idx_range_rep : public idx_base_rep
   {
   public:
+    idx_range_rep (void)
+      : start(0), len(0), step(1) { }
+
     idx_range_rep (octave_idx_type _start, octave_idx_type _len,
                    octave_idx_type _step, direct)
       : idx_base_rep (), start(_start), len(_len), step(_step) { }
 
-    idx_range_rep (void)
-      : start(0), len(0), step(1) { }
+    // No copying!
+
+    idx_range_rep (const idx_range_rep& idx) = delete;
+
+    idx_range_rep& operator = (const idx_range_rep& idx) = delete;
 
     // Zero-based constructor.
     idx_range_rep (octave_idx_type _start, octave_idx_type _limit,
@@ -213,25 +215,24 @@
 
   private:
 
-    // No copying!
-
-    idx_range_rep (const idx_range_rep& idx) = delete;
-
-    idx_range_rep& operator = (const idx_range_rep& idx) = delete;
-
     octave_idx_type start, len, step;
-
   };
 
   // The integer scalar index.
   class OCTAVE_API idx_scalar_rep : public idx_base_rep
   {
   public:
+    idx_scalar_rep (void)
+      : data (0) { }
+
     idx_scalar_rep (octave_idx_type i, direct)
       : data (i) { }
 
-    idx_scalar_rep (void)
-      : data (0) { }
+    // No copying!
+
+    idx_scalar_rep (const idx_scalar_rep& idx) = delete;
+
+    idx_scalar_rep& operator = (const idx_scalar_rep& idx) = delete;
 
     // Zero-based constructor.
     idx_scalar_rep (octave_idx_type i);
@@ -270,29 +271,22 @@
 
   private:
 
-    // No copying!
-
-    idx_scalar_rep (const idx_scalar_rep& idx) = delete;
-
-    idx_scalar_rep& operator = (const idx_scalar_rep& idx) = delete;
-
     octave_idx_type data;
-
   };
 
   // The integer vector index.
   class OCTAVE_API idx_vector_rep : public idx_base_rep
   {
   public:
+    idx_vector_rep (void)
+      : data (0), len (0), ext (0), aowner (0), orig_dims ()
+    { }
+
     // Direct constructor.
     idx_vector_rep (octave_idx_type *_data, octave_idx_type _len,
                     octave_idx_type _ext, const dim_vector& od, direct)
       : data (_data), len (_len), ext (_ext), aowner (0), orig_dims (od) { }
 
-    idx_vector_rep (void)
-      : data (0), len (0), ext (0), aowner (0), orig_dims ()
-    { }
-
     // Zero-based constructor.
     idx_vector_rep (const Array<octave_idx_type>& inda);
 
@@ -308,6 +302,12 @@
 
     idx_vector_rep (const Sparse<bool>&);
 
+    // No copying!
+
+    idx_vector_rep (const idx_vector_rep& idx) = delete;
+
+    idx_vector_rep& operator = (const idx_vector_rep& idx) = delete;
+
     ~idx_vector_rep (void);
 
     octave_idx_type xelem (octave_idx_type i) const { return data[i]; }
@@ -337,12 +337,6 @@
 
   private:
 
-    // No copying!
-
-    idx_vector_rep (const idx_vector_rep& idx) = delete;
-
-    idx_vector_rep& operator = (const idx_vector_rep& idx) = delete;
-
     const octave_idx_type *data;
     octave_idx_type len;
     octave_idx_type ext;
@@ -363,21 +357,27 @@
   class OCTAVE_API idx_mask_rep : public idx_base_rep
   {
   public:
+    idx_mask_rep (void)
+      : data (0), len (0), ext (0), lsti (-1), lste (-1), aowner (0),
+        orig_dims ()
+    { }
+
     // Direct constructor.
     idx_mask_rep (bool *_data, octave_idx_type _len,
                   octave_idx_type _ext, const dim_vector& od, direct)
       : data (_data), len (_len), ext (_ext), lsti (-1), lste (-1),
         aowner (0), orig_dims (od) { }
 
-    idx_mask_rep (void)
-      : data (0), len (0), ext (0), lsti (-1), lste (-1), aowner (0),
-        orig_dims ()
-    { }
-
     idx_mask_rep (bool);
 
     idx_mask_rep (const Array<bool>&, octave_idx_type = -1);
 
+    // No copying!
+
+    idx_mask_rep (const idx_mask_rep& idx) = delete;
+
+    idx_mask_rep& operator = (const idx_mask_rep& idx) = delete;
+
     ~idx_mask_rep (void);
 
     octave_idx_type xelem (octave_idx_type i) const;
@@ -411,12 +411,6 @@
 
   private:
 
-    // No copying!
-
-    idx_mask_rep (const idx_mask_rep& idx) = delete;
-
-    idx_mask_rep& operator = (const idx_mask_rep& idx) = delete;
-
     const bool *data;
     octave_idx_type len;
     octave_idx_type ext;