aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/CellBuffer.h
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2022-07-29 11:16:28 +1000
committerNeil <nyamatongwe@gmail.com>2022-07-29 11:16:28 +1000
commite030b1d56785405cb35531758d603be88af9b487 (patch)
tree9a428393f7963d50a0b7557e7c77ac1be37c7bb3 /src/CellBuffer.h
parent6e6641d4733903d3c365fd9348f3656ff7000ddf (diff)
downloadscintilla-mirror-e030b1d56785405cb35531758d603be88af9b487.tar.gz
Apply rule-of-zero to delete standard methods where possible as handled by
contained types. This allows flexibility as most lower-level data types can be moved and SplitVector and Partitioning of non-move-only types may be copied. CellBuffer still needs destructor due to incomplete type so retains all standard operations.
Diffstat (limited to 'src/CellBuffer.h')
-rw-r--r--src/CellBuffer.h19
1 files changed, 3 insertions, 16 deletions
diff --git a/src/CellBuffer.h b/src/CellBuffer.h
index d8914d7ba..727e14944 100644
--- a/src/CellBuffer.h
+++ b/src/CellBuffer.h
@@ -39,13 +39,6 @@ public:
bool mayCoalesce;
Action() noexcept;
- // Deleted so Action objects can not be copied.
- Action(const Action &other) = delete;
- Action &operator=(const Action &other) = delete;
- Action &operator=(const Action &&other) = delete;
- // Move constructor allows vector to be resized without reallocating.
- Action(Action &&other) noexcept = default;
- ~Action();
void Create(ActionType at_, Sci::Position position_=0, const char *data_=nullptr, Sci::Position lenData_=0, bool mayCoalesce_=true);
void Clear() noexcept;
};
@@ -65,12 +58,6 @@ class UndoHistory {
public:
UndoHistory();
- // Deleted so UndoHistory objects can not be copied.
- UndoHistory(const UndoHistory &) = delete;
- UndoHistory(UndoHistory &&) = delete;
- void operator=(const UndoHistory &) = delete;
- void operator=(UndoHistory &&) = delete;
- ~UndoHistory();
const char *AppendAction(ActionType at, Sci::Position position, const char *data, Sci::Position lengthData, bool &startSequence, bool mayCoalesce=true);
@@ -163,9 +150,9 @@ public:
// Deleted so CellBuffer objects can not be copied.
CellBuffer(const CellBuffer &) = delete;
CellBuffer(CellBuffer &&) = delete;
- void operator=(const CellBuffer &) = delete;
- void operator=(CellBuffer &&) = delete;
- ~CellBuffer();
+ CellBuffer &operator=(const CellBuffer &) = delete;
+ CellBuffer &operator=(CellBuffer &&) = delete;
+ ~CellBuffer() noexcept;
/// Retrieving positions outside the range of the buffer works and returns 0
char CharAt(Sci::Position position) const noexcept;