File tree 3 files changed +40
-14
lines changed
3 files changed +40
-14
lines changed Original file line number Diff line number Diff line change @@ -1532,13 +1532,12 @@ bool instrumentert::is_cfg_spurious(const event_grapht::critical_cyclet &cyc)
1532
1532
}
1533
1533
1534
1534
/* now test whether this part of the code can exist */
1535
+ goto_functionst::function_mapt map;
1535
1536
goto_function_templatet<goto_programt> one_interleaving;
1536
1537
one_interleaving.body .copy_from (interleaving);
1537
-
1538
- std::pair<irep_idt, goto_function_templatet<goto_programt> > p (
1539
- goto_functionst::entry_point (), one_interleaving);
1540
- goto_functionst::function_mapt map;
1541
- map.insert (p);
1538
+ map.insert (std::make_pair (
1539
+ goto_functionst::entry_point (),
1540
+ std::move (one_interleaving)));
1542
1541
1543
1542
goto_functionst this_interleaving;
1544
1543
this_interleaving.function_map =std::move (map);
Original file line number Diff line number Diff line change @@ -17,6 +17,29 @@ Date: June 2003
17
17
class goto_functionst :public goto_functions_templatet <goto_programt>
18
18
{
19
19
public:
20
+ goto_functionst ()=default ;
21
+
22
+ // Copying is unavailable as base class copy is deleted
23
+ // MSVC is unable to automatically determine this
24
+ goto_functionst (const goto_functionst &)=delete ;
25
+ goto_functionst &operator =(const goto_functionst &)=delete ;
26
+
27
+ // Move operations need to be explicitly enabled as they are deleted with the
28
+ // copy operations
29
+ // default for move operations isn't available on Windows yet, so define
30
+ // explicitly (see https://msdn.microsoft.com/en-us/library/hh567368.aspx
31
+ // under "Defaulted and Deleted Functions")
32
+
33
+ goto_functionst (goto_functionst &&other):
34
+ goto_functions_templatet (std::move(other))
35
+ {
36
+ }
37
+
38
+ goto_functionst &operator =(goto_functionst &&other)
39
+ {
40
+ goto_functions_templatet::operator =(std::move (other));
41
+ return *this ;
42
+ }
20
43
};
21
44
22
45
#define Forall_goto_functions (it, functions ) \
Original file line number Diff line number Diff line change @@ -73,12 +73,8 @@ class goto_function_templatet
73
73
parameter_identifiers=other.parameter_identifiers ;
74
74
}
75
75
76
- goto_function_templatet (const goto_function_templatet &other)
77
- : type(other.type),
78
- parameter_identifiers (other.parameter_identifiers)
79
- {
80
- body.copy_from (other.body );
81
- }
76
+ goto_function_templatet (const goto_function_templatet &)=delete ;
77
+ goto_function_templatet &operator =(const goto_function_templatet &)=delete ;
82
78
83
79
goto_function_templatet (goto_function_templatet &&other):
84
80
body (std::move(other.body)),
@@ -108,10 +104,18 @@ class goto_functions_templatet
108
104
{
109
105
}
110
106
111
- // copy constructor, don't use me!
112
- goto_functions_templatet (const goto_functions_templatet<bodyT> &src)
107
+ goto_functions_templatet (const goto_functions_templatet &)=delete ;
108
+ goto_functions_templatet &operator =(const goto_functions_templatet &)=delete ;
109
+
110
+ goto_functions_templatet (goto_functions_templatet &&other):
111
+ function_map (std::move(other.function_map))
112
+ {
113
+ }
114
+
115
+ goto_functions_templatet &operator =(goto_functions_templatet &&other)
113
116
{
114
- assert (src.function_map .empty ());
117
+ function_map=std::move (other.function_map );
118
+ return *this ;
115
119
}
116
120
117
121
void clear ()
You can’t perform that action at this time.
0 commit comments