Mercurial > octave
annotate liboctave/util/unwind-prot.h @ 22865:89756f2f085b
use c++11 style for deleting default copy constructor and assignment operator
* 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-cbinop.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:
Use C++11 style "= delete" declaration to declare copy constructors
and assignment operators for classes that should not be copied.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 05 Dec 2016 22:59:37 -0500 |
parents | 3a2b891d0b33 |
children | f75d289645ec |
rev | line source |
---|---|
1 | 1 /* |
2 | |
22323
bac0d6f07a3e
maint: Update copyright notices for 2016.
John W. Eaton <jwe@octave.org>
parents:
21752
diff
changeset
|
3 Copyright (C) 1993-2016 John W. Eaton |
11523 | 4 Copyright (C) 2009-2010 VZLU Prague |
1 | 5 |
6 This file is part of Octave. | |
7 | |
8 Octave is free software; you can redistribute it and/or modify it | |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22402
diff
changeset
|
9 under the terms of the GNU General Public License as published by |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22402
diff
changeset
|
10 the Free Software Foundation; either version 3 of the License, or |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22402
diff
changeset
|
11 (at your option) any later version. |
1 | 12 |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22402
diff
changeset
|
13 Octave is distributed in the hope that it will be useful, but |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22402
diff
changeset
|
14 WITHOUT ANY WARRANTY; without even the implied warranty of |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22402
diff
changeset
|
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22402
diff
changeset
|
16 GNU General Public License for more details. |
1 | 17 |
18 You should have received a copy of the GNU General Public License | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
1 | 21 |
22 */ | |
23 | |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
20545
diff
changeset
|
24 #if ! defined (octave_unwind_prot_h) |
383 | 25 #define octave_unwind_prot_h 1 |
1 | 26 |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21141
diff
changeset
|
27 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21141
diff
changeset
|
28 |
17552
d07d59cc8775
move unwind-protect to liboctave
John W. Eaton <jwe@octave.org>
parents:
16892
diff
changeset
|
29 #include <cstddef> |
d07d59cc8775
move unwind-protect to liboctave
John W. Eaton <jwe@octave.org>
parents:
16892
diff
changeset
|
30 |
15396 | 31 #include <stack> |
9394
b3ab22ee8544
further improve unwind_protect
Jaroslav Hajek <highegg@gmail.com>
parents:
9384
diff
changeset
|
32 #include <memory> |
240 | 33 |
15396 | 34 #include "action-container.h" |
35 | |
21743
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
36 namespace octave |
2985 | 37 { |
21743
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
38 class |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
39 OCTAVE_API |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
40 unwind_protect : public action_container |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
41 { |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
42 public: |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
43 |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
44 unwind_protect (void) : lifo () { } |
2985 | 45 |
21743
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
46 // Destructor should not raise an exception, so all actions |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
47 // registered should be exception-safe. If you're not sure, see |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
48 // unwind_protect_safe. |
9394
b3ab22ee8544
further improve unwind_protect
Jaroslav Hajek <highegg@gmail.com>
parents:
9384
diff
changeset
|
49 |
21743
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
50 ~unwind_protect (void) { run (); } |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
51 |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
52 virtual void add (elem *new_elem) |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
53 { |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
54 lifo.push (new_elem); |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
55 } |
9396
17af7cce7d1b
yet more unwind_protect improvements
Jaroslav Hajek <highegg@gmail.com>
parents:
9394
diff
changeset
|
56 |
21743
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
57 OCTAVE_DEPRECATED ("use 'add (new fcn_arg_elem<void *> (fcn, ptr))' instead") |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
58 void add (void (*fcn) (void *), void *ptr = 0) |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
59 { |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
60 add (new fcn_arg_elem<void *> (fcn, ptr)); |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
61 } |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
62 |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
63 operator bool (void) const { return ! empty (); } |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
64 |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
65 OCTAVE_DEPRECATED ("use 'run_first' instead") |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
66 void run_top (void) { run_first (); } |
10781
f7584d0ba5d3
allow unwind_protect register actions with const T& args
Jaroslav Hajek <highegg@gmail.com>
parents:
10343
diff
changeset
|
67 |
21743
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
68 void run_first (void) |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
69 { |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
70 if (! empty ()) |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
71 { |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
72 // No leak on exception! |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
73 std::unique_ptr<elem> ptr (lifo.top ()); |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
74 lifo.pop (); |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
75 ptr->run (); |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
76 } |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
77 } |
12122
f4689107dd8c
Explicitly disallow copying in some classes.
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents:
11586
diff
changeset
|
78 |
21743
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
79 OCTAVE_DEPRECATED ("use 'run' instead") |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
80 void run_top (int num) { run (num); } |
12122
f4689107dd8c
Explicitly disallow copying in some classes.
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents:
11586
diff
changeset
|
81 |
21743
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
82 OCTAVE_DEPRECATED ("use 'discard_first' instead") |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
83 void discard_top (void) { discard_first (); } |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
84 |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
85 void discard_first (void) |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
86 { |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
87 if (! empty ()) |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
88 { |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
89 elem *ptr = lifo.top (); |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
90 lifo.pop (); |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
91 delete ptr; |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
92 } |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
93 } |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
94 |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
95 OCTAVE_DEPRECATED ("use 'discard' instead") |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
96 void discard_top (int num) { discard (num); } |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
97 |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
98 size_t size (void) const { return lifo.size (); } |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
99 |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
100 protected: |
9376
d58086453171
refactor unwind_protect
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
101 |
21743
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
102 std::stack<elem *> lifo; |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
103 |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
104 private: |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
105 |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
106 // No copying! |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
107 |
22865
89756f2f085b
use c++11 style for deleting default copy constructor and assignment operator
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
108 unwind_protect (const unwind_protect&) = delete; |
9394
b3ab22ee8544
further improve unwind_protect
Jaroslav Hajek <highegg@gmail.com>
parents:
9384
diff
changeset
|
109 |
22865
89756f2f085b
use c++11 style for deleting default copy constructor and assignment operator
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
110 unwind_protect& operator = (const unwind_protect&) = delete; |
21743
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
111 }; |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
112 |
21751
b571fc85953f
maint: Use two spaces after period to indicate sentence break.
Rik <rik@octave.org>
parents:
21743
diff
changeset
|
113 // Like unwind_protect, but this one will guard against the possibility |
b571fc85953f
maint: Use two spaces after period to indicate sentence break.
Rik <rik@octave.org>
parents:
21743
diff
changeset
|
114 // of seeing an exception (or interrupt) in the cleanup actions. |
b571fc85953f
maint: Use two spaces after period to indicate sentence break.
Rik <rik@octave.org>
parents:
21743
diff
changeset
|
115 // Not that we can do much about it, but at least we won't crash. |
21743
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
116 |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
117 class |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
118 OCTAVE_API |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
119 unwind_protect_safe : public unwind_protect |
15396 | 120 { |
21743
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
121 private: |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
122 |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
123 void warn_unhandled_exception (void) const; |
9396
17af7cce7d1b
yet more unwind_protect improvements
Jaroslav Hajek <highegg@gmail.com>
parents:
9394
diff
changeset
|
124 |
21743
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
125 public: |
9396
17af7cce7d1b
yet more unwind_protect improvements
Jaroslav Hajek <highegg@gmail.com>
parents:
9394
diff
changeset
|
126 |
21743
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
127 unwind_protect_safe (void) : unwind_protect () { } |
9394
b3ab22ee8544
further improve unwind_protect
Jaroslav Hajek <highegg@gmail.com>
parents:
9384
diff
changeset
|
128 |
21743
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
129 ~unwind_protect_safe (void) |
22402
4caa7b28d183
maint: Style check C++ code in liboctave/
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
130 { |
4caa7b28d183
maint: Style check C++ code in liboctave/
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
131 while (! empty ()) |
4caa7b28d183
maint: Style check C++ code in liboctave/
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
132 { |
4caa7b28d183
maint: Style check C++ code in liboctave/
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
133 try |
4caa7b28d183
maint: Style check C++ code in liboctave/
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
134 { |
4caa7b28d183
maint: Style check C++ code in liboctave/
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
135 run_first (); |
4caa7b28d183
maint: Style check C++ code in liboctave/
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
136 } |
4caa7b28d183
maint: Style check C++ code in liboctave/
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
137 catch (...) // Yes, the black hole. Remember we're in a destructor. |
4caa7b28d183
maint: Style check C++ code in liboctave/
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
138 { |
4caa7b28d183
maint: Style check C++ code in liboctave/
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
139 warn_unhandled_exception (); |
4caa7b28d183
maint: Style check C++ code in liboctave/
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
140 } |
4caa7b28d183
maint: Style check C++ code in liboctave/
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
141 } |
4caa7b28d183
maint: Style check C++ code in liboctave/
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
142 } |
21743
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
143 |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
144 private: |
15396 | 145 |
21743
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
146 // No copying! |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
147 |
22865
89756f2f085b
use c++11 style for deleting default copy constructor and assignment operator
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
148 unwind_protect_safe (const unwind_protect_safe&) = delete; |
15396 | 149 |
22865
89756f2f085b
use c++11 style for deleting default copy constructor and assignment operator
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
150 unwind_protect_safe& operator = (const unwind_protect_safe&) = delete; |
21743
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
151 }; |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
152 } |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
153 |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
154 #if defined (OCTAVE_USE_DEPRECATED_FUNCTIONS) |
15396 | 155 |
21752
949cb46e6bdb
use consistent style for deprecated function/class messages
John W. Eaton <jwe@octave.org>
parents:
21751
diff
changeset
|
156 OCTAVE_DEPRECATED ("use 'octave::unwind_protect' instead") |
21743
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
157 typedef octave::unwind_protect unwind_protect; |
15396 | 158 |
21752
949cb46e6bdb
use consistent style for deprecated function/class messages
John W. Eaton <jwe@octave.org>
parents:
21751
diff
changeset
|
159 OCTAVE_DEPRECATED ("use 'octave::unwind_protect_safe' instead") |
21743
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
160 typedef octave::unwind_protect_safe unwind_protect_safe; |
2985 | 161 |
1 | 162 #endif |
21743
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
163 |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21307
diff
changeset
|
164 #endif |
22402
4caa7b28d183
maint: Style check C++ code in liboctave/
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
165 |