changeset 21307:61c96c37ce69

Use std::unique_ptr to replace deprecated std::auto_ptr. * ov-cell.h, event-queue.h, txt-eng.h, idx-vector.cc, idx-vector.h, unwind-prot.h: Use std::unique_ptr to replace deprecated std::auto_ptr.
author Rik <rik@octave.org>
date Fri, 19 Feb 2016 09:41:41 -0800
parents 0152d8745c3d
children c53bfd6d8e08
files libinterp/corefcn/event-queue.h libinterp/corefcn/txt-eng.h libinterp/octave-value/ov-cell.h liboctave/array/idx-vector.cc liboctave/array/idx-vector.h liboctave/util/unwind-prot.h
diffstat 6 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/event-queue.h	Thu Feb 18 21:20:01 2016 -0800
+++ b/libinterp/corefcn/event-queue.h	Fri Feb 19 09:41:41 2016 -0800
@@ -53,7 +53,7 @@
     if (! empty ())
       {
         // No leak on exception!
-        std::auto_ptr<elem> ptr (fifo.front ());
+        std::unique_ptr<elem> ptr (fifo.front ());
         fifo.pop ();
         ptr->run ();
       }
--- a/libinterp/corefcn/txt-eng.h	Thu Feb 18 21:20:01 2016 -0800
+++ b/libinterp/corefcn/txt-eng.h	Fri Feb 19 09:41:41 2016 -0800
@@ -440,7 +440,7 @@
 inline text_element*
 text_parser::parse (const std::string& s, const caseless_str& interpreter)
 {
-  std::auto_ptr<text_parser> parser;
+  std::unique_ptr<text_parser> parser;
 
   if (interpreter.compare ("tex"))
     parser.reset (new text_parser_tex ());
--- a/libinterp/octave-value/ov-cell.h	Thu Feb 18 21:20:01 2016 -0800
+++ b/libinterp/octave-value/ov-cell.h	Fri Feb 19 09:41:41 2016 -0800
@@ -182,7 +182,7 @@
   void clear_cellstr_cache (void) const
   { cellstr_cache.reset (); }
 
-  mutable std::auto_ptr<Array<std::string> > cellstr_cache;
+  mutable std::unique_ptr<Array<std::string> > cellstr_cache;
 
 
   DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
--- a/liboctave/array/idx-vector.cc	Thu Feb 18 21:20:01 2016 -0800
+++ b/liboctave/array/idx-vector.cc	Fri Feb 19 09:41:41 2016 -0800
@@ -448,8 +448,8 @@
       return this;
     }
 
-  // This is wrapped in auto_ptr so that we don't leak on out-of-memory.
-  std::auto_ptr<idx_vector_rep> new_rep (
+  // This is wrapped in unique_ptr so that we don't leak on out-of-memory.
+  std::unique_ptr<idx_vector_rep> new_rep (
     new idx_vector_rep (0, len, ext, orig_dims, DIRECT));
 
   if (ext > len*xlog2 (1.0 + len))
@@ -521,8 +521,8 @@
 idx_vector::idx_base_rep *
 idx_vector::idx_vector_rep::sort_idx (Array<octave_idx_type>& idx)
 {
-  // This is wrapped in auto_ptr so that we don't leak on out-of-memory.
-  std::auto_ptr<idx_vector_rep> new_rep (
+  // This is wrapped in unique_ptr so that we don't leak on out-of-memory.
+  std::unique_ptr<idx_vector_rep> new_rep (
     new idx_vector_rep (0, len, ext, orig_dims, DIRECT));
 
   if (ext > len*xlog2 (1.0 + len))
--- a/liboctave/array/idx-vector.h	Thu Feb 18 21:20:01 2016 -0800
+++ b/liboctave/array/idx-vector.h	Fri Feb 19 09:41:41 2016 -0800
@@ -65,7 +65,7 @@
     class_mask
   };
 
-  template <typename T> friend class std::auto_ptr;
+  template <typename T> friend class std::unique_ptr;
 
 private:
 
--- a/liboctave/util/unwind-prot.h	Thu Feb 18 21:20:01 2016 -0800
+++ b/liboctave/util/unwind-prot.h	Fri Feb 19 09:41:41 2016 -0800
@@ -68,7 +68,7 @@
     if (! empty ())
       {
         // No leak on exception!
-        std::auto_ptr<elem> ptr (lifo.top ());
+        std::unique_ptr<elem> ptr (lifo.top ());
         lifo.pop ();
         ptr->run ();
       }