Skip to content

Commit

Permalink
Disallow copy and assign
Browse files Browse the repository at this point in the history
  • Loading branch information
JayXon committed Sep 8, 2018
1 parent 78d9ae9 commit 95ab165
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fileio.h
Expand Up @@ -29,6 +29,10 @@ class File {
UnMapFile(size_);
}

// Disallow copy and assign.
File(const File&) = delete;
File& operator=(const File&) = delete;

void* GetFilePionter() const {
return fp_;
}
Expand Down
4 changes: 4 additions & 0 deletions formats/format.h
Expand Up @@ -13,6 +13,10 @@ class Format {

virtual ~Format() = default;

// Disallow copy and assign.
Format(const Format&) = delete;
Format& operator=(const Format&) = delete;

virtual size_t Leanify(size_t size_leanified = 0) {
if (size_leanified) {
memmove(fp_ - size_leanified, fp_, size_);
Expand Down

0 comments on commit 95ab165

Please sign in to comment.