Skip to content

Commit 861dd3e

Browse files
committed
Make node_persistent_cache class non-copyable and non-movable
node_persistent_cache has a handle to an open file internally, copying or moving will not work without special handling. But we don't want to copy or move it anyway, so just disabling that is okay.
1 parent cb4b734 commit 861dd3e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/node-persistent-cache.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ class node_persistent_cache
2424
node_persistent_cache(std::string file_name, bool remove_file);
2525
~node_persistent_cache() noexcept;
2626

27+
node_persistent_cache(node_persistent_cache const &) = delete;
28+
node_persistent_cache &operator=(node_persistent_cache const &) = delete;
29+
30+
node_persistent_cache(node_persistent_cache &&) = delete;
31+
node_persistent_cache &operator=(node_persistent_cache &&) = delete;
32+
2733
void set(osmid_t id, osmium::Location location);
2834
osmium::Location get(osmid_t id) const noexcept;
2935

0 commit comments

Comments
 (0)