@@ -66,18 +66,29 @@ class goto_function_templatet
66
66
parameter_identifiers.swap (other.parameter_identifiers );
67
67
}
68
68
69
- void copy_from (const goto_function_templatet<bodyT> &other)
69
+ void copy_from (const goto_function_templatet &other)
70
70
{
71
71
body.copy_from (other.body );
72
72
type=other.type ;
73
73
parameter_identifiers=other.parameter_identifiers ;
74
74
}
75
75
76
- goto_function_templatet (const goto_function_templatet<bodyT> &src):
77
- type (src.type),
78
- parameter_identifiers (src.parameter_identifiers)
76
+ goto_function_templatet (const goto_function_templatet &)=delete ;
77
+ goto_function_templatet &operator =(const goto_function_templatet &)=delete ;
78
+
79
+ goto_function_templatet (goto_function_templatet &&other):
80
+ body (std::move(other.body)),
81
+ type (std::move(other.type)),
82
+ parameter_identifiers (std::move(other.parameter_identifiers))
83
+ {
84
+ }
85
+
86
+ goto_function_templatet &operator =(goto_function_templatet &&other)
79
87
{
80
- body.copy_from (src.body );
88
+ body=std::move (other.body );
89
+ type=std::move (other.type );
90
+ parameter_identifiers=std::move (other.parameter_identifiers );
91
+ return *this ;
81
92
}
82
93
};
83
94
@@ -93,10 +104,18 @@ class goto_functions_templatet
93
104
{
94
105
}
95
106
96
- // copy constructor, don't use me!
97
- 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)
98
116
{
99
- assert (src.function_map .empty ());
117
+ function_map=std::move (other.function_map );
118
+ return *this ;
100
119
}
101
120
102
121
void clear ()
0 commit comments