# HG changeset patch # User Rik # Date 1455903701 28800 # Node ID 61c96c37ce69d9410866b2d15e185c792d74f8f9 # Parent 0152d8745c3dc95c4c2679d8b25894c6879279e5 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. diff -r 0152d8745c3d -r 61c96c37ce69 libinterp/corefcn/event-queue.h --- 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 ptr (fifo.front ()); + std::unique_ptr ptr (fifo.front ()); fifo.pop (); ptr->run (); } diff -r 0152d8745c3d -r 61c96c37ce69 libinterp/corefcn/txt-eng.h --- 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 parser; + std::unique_ptr parser; if (interpreter.compare ("tex")) parser.reset (new text_parser_tex ()); diff -r 0152d8745c3d -r 61c96c37ce69 libinterp/octave-value/ov-cell.h --- 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 > cellstr_cache; + mutable std::unique_ptr > cellstr_cache; DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA diff -r 0152d8745c3d -r 61c96c37ce69 liboctave/array/idx-vector.cc --- 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 new_rep ( + // This is wrapped in unique_ptr so that we don't leak on out-of-memory. + std::unique_ptr 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& idx) { - // This is wrapped in auto_ptr so that we don't leak on out-of-memory. - std::auto_ptr new_rep ( + // This is wrapped in unique_ptr so that we don't leak on out-of-memory. + std::unique_ptr new_rep ( new idx_vector_rep (0, len, ext, orig_dims, DIRECT)); if (ext > len*xlog2 (1.0 + len)) diff -r 0152d8745c3d -r 61c96c37ce69 liboctave/array/idx-vector.h --- 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 friend class std::auto_ptr; + template friend class std::unique_ptr; private: diff -r 0152d8745c3d -r 61c96c37ce69 liboctave/util/unwind-prot.h --- 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 ptr (lifo.top ()); + std::unique_ptr ptr (lifo.top ()); lifo.pop (); ptr->run (); }