AP_Common: added CLASS_NO_COPY() macro

used to make it easy to forbid copy of classes
This commit is contained in:
Andrew Tridgell 2021-06-06 18:26:25 +10:00
parent 438ca0a6c4
commit 6c0c6a1f48
1 changed files with 3 additions and 0 deletions

View File

@ -45,6 +45,9 @@
#define FMT_PRINTF(a,b) __attribute__((format(printf, a, b)))
#define FMT_SCANF(a,b) __attribute__((format(scanf, a, b)))
// used to forbid copy of objects
#define CLASS_NO_COPY(c) c(const c &other) = delete; c &operator=(const c&) = delete
#ifdef __has_cpp_attribute
# if __has_cpp_attribute(fallthrough)
# define FALLTHROUGH [[fallthrough]]