Skip to content

Commit

Permalink
src: disallow copy/move fns/constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig committed Jan 29, 2025
1 parent e346323 commit 6eb550e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,15 @@ constexpr size_t strsize(const T (&)[N]) {
template <typename T, size_t kStackStorageSize = 1024>
class MaybeStackBuffer {
public:
// Disallow move constructor
MaybeStackBuffer(MaybeStackBuffer&&) = delete;
// Disallow copy constructor
MaybeStackBuffer(const MaybeStackBuffer&) = delete;
// Disallow move assignment operator
MaybeStackBuffer& operator=(MaybeStackBuffer&& other) = delete;
// Disallow copy assignment operator
MaybeStackBuffer& operator=(MaybeStackBuffer& other) = delete;

const T* out() const {
return buf_;
}
Expand Down

0 comments on commit 6eb550e

Please sign in to comment.