Enable goto_modelt move assignment#880
Conversation
|
This fails on windows because it doesn't understand On clang and gcc these should be |
fc0dc98 to
75a9525
Compare
src/goto-programs/goto_model.h
Outdated
There was a problem hiding this comment.
My preference is to implement operator= always in terms of swap:
swap(other);
return *this;There was a problem hiding this comment.
Surely that's less efficient as you're doing two moves instead of one?
75a9525 to
ac8a88e
Compare
src/goto-programs/goto_model.h
Outdated
There was a problem hiding this comment.
This uses more stack than necessary. Can just
swap(other);
return *this;There was a problem hiding this comment.
Sorry, wasn't thinking, of course you can if it's a move assignment.
6fd6cb9 to
1e2447d
Compare
goto_modelt move assignment
goto_modelt move assignment
src/goto-programs/goto_functions.h
Outdated
There was a problem hiding this comment.
put colon at end of previous line (several occurrences)
Propagate this change through goto_programt and goto_function_templatet
Rather than telling people not to use the copy constructor, actually don't use it
1e2447d to
389fbcd
Compare
Previously
goto_modeltimplemented a non-standard move constructor and didn't enable the assignment operator. This replaces that code with the standard way of achieving the desired result.This also removes the copy constructor from
goto_functions_templatetrather than just telling people not to use it.