Skip to content

Commit f313e7f

Browse files
committed
Fix tempdirt to prevent copying and allow moving
1 parent 0c08382 commit f313e7f

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/util/tempdir.h

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,21 @@ std::string get_temporary_directory(const std::string &name_template);
1919
class temp_dirt
2020
{
2121
public:
22-
std::string path;
22+
explicit temp_dirt(const std::string &name_template);
23+
~temp_dirt();
24+
25+
temp_dirt(const temp_dirt &) = delete;
26+
27+
temp_dirt(temp_dirt &&other)
28+
{
29+
path.swap(other.path);
30+
}
2331

2432
std::string operator()(const std::string &file);
2533

2634
void clear();
2735

28-
explicit temp_dirt(const std::string &name_template);
29-
~temp_dirt();
36+
std::string path;
3037
};
3138

3239
#endif // CPROVER_UTIL_TEMPDIR_H

0 commit comments

Comments
 (0)