mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-21 17:13:09 +08:00
Delete assignment and copy constructor for ELIST
Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
b0b5600c30
commit
4a628729b2
@ -91,12 +91,13 @@ public:
|
||||
}
|
||||
// constructor
|
||||
|
||||
ELIST_LINK(const ELIST_LINK &) { // don't copy link.
|
||||
// The special copy constructor is used by lots of classes.
|
||||
ELIST_LINK(const ELIST_LINK &) {
|
||||
next = nullptr;
|
||||
}
|
||||
|
||||
void operator=( // don't copy links
|
||||
const ELIST_LINK &) {
|
||||
// The special assignment operator is used by lots of classes.
|
||||
void operator=(const ELIST_LINK &) {
|
||||
next = nullptr;
|
||||
}
|
||||
};
|
||||
@ -876,14 +877,9 @@ ELISTIZEH_C.
|
||||
/* Become a deep copy of src_list*/ \
|
||||
void deep_copy(const CLASSNAME##_LIST *src_list, CLASSNAME *(*copier)(const CLASSNAME *)); \
|
||||
\
|
||||
private: \
|
||||
/* Prevent assign and copy construction. */ \
|
||||
CLASSNAME##_LIST(const CLASSNAME##_LIST &) { \
|
||||
DONT_CONSTRUCT_LIST_BY_COPY.error(QUOTE_IT(CLASSNAME##_LIST), ABORT, nullptr); \
|
||||
} \
|
||||
void operator=(const CLASSNAME##_LIST &) { \
|
||||
DONT_ASSIGN_LISTS.error(QUOTE_IT(CLASSNAME##_LIST), ABORT, nullptr); \
|
||||
}
|
||||
CLASSNAME##_LIST(const CLASSNAME##_LIST &) = delete; \
|
||||
void operator=(const CLASSNAME##_LIST &) = delete; \
|
||||
|
||||
#define ELISTIZEH_C(CLASSNAME) \
|
||||
} \
|
||||
|
@ -23,8 +23,6 @@
|
||||
|
||||
namespace tesseract {
|
||||
|
||||
constexpr ERRCODE DONT_CONSTRUCT_LIST_BY_COPY("Can't create a list by assignment");
|
||||
constexpr ERRCODE DONT_ASSIGN_LISTS("Can't assign to lists");
|
||||
constexpr ERRCODE SERIALISE_LINKS("Attempted to (de)serialise a link element");
|
||||
|
||||
#ifndef NDEBUG
|
||||
|
Loading…
Reference in New Issue
Block a user