mirror of
https://github.com/fmtlib/fmt.git
synced 2024-10-02 13:02:03 +00:00
[clang-tidy] Turn deleted function to public
Found with modernize-use-equals-delete Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
0047dc10a2
commit
8a411c2bca
@ -552,9 +552,6 @@ using has_formatter =
|
|||||||
/** A contiguous memory buffer with an optional growing ability. */
|
/** A contiguous memory buffer with an optional growing ability. */
|
||||||
template <typename T> class buffer {
|
template <typename T> class buffer {
|
||||||
private:
|
private:
|
||||||
buffer(const buffer&) = delete;
|
|
||||||
void operator=(const buffer&) = delete;
|
|
||||||
|
|
||||||
T* ptr_;
|
T* ptr_;
|
||||||
std::size_t size_;
|
std::size_t size_;
|
||||||
std::size_t capacity_;
|
std::size_t capacity_;
|
||||||
@ -581,6 +578,8 @@ template <typename T> class buffer {
|
|||||||
using value_type = T;
|
using value_type = T;
|
||||||
using const_reference = const T&;
|
using const_reference = const T&;
|
||||||
|
|
||||||
|
buffer(const buffer&) = delete;
|
||||||
|
void operator=(const buffer&) = delete;
|
||||||
virtual ~buffer() {}
|
virtual ~buffer() {}
|
||||||
|
|
||||||
T* begin() FMT_NOEXCEPT { return ptr_; }
|
T* begin() FMT_NOEXCEPT { return ptr_; }
|
||||||
@ -1035,9 +1034,6 @@ namespace internal {
|
|||||||
// A map from argument names to their values for named arguments.
|
// A map from argument names to their values for named arguments.
|
||||||
template <typename Context> class arg_map {
|
template <typename Context> class arg_map {
|
||||||
private:
|
private:
|
||||||
arg_map(const arg_map&) = delete;
|
|
||||||
void operator=(const arg_map&) = delete;
|
|
||||||
|
|
||||||
using char_type = typename Context::char_type;
|
using char_type = typename Context::char_type;
|
||||||
|
|
||||||
struct entry {
|
struct entry {
|
||||||
@ -1055,6 +1051,8 @@ template <typename Context> class arg_map {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
arg_map(const arg_map&) = delete;
|
||||||
|
void operator=(const arg_map&) = delete;
|
||||||
arg_map() : map_(nullptr), size_(0) {}
|
arg_map() : map_(nullptr), size_(0) {}
|
||||||
void init(const basic_format_args<Context>& args);
|
void init(const basic_format_args<Context>& args);
|
||||||
~arg_map() { delete[] map_; }
|
~arg_map() { delete[] map_; }
|
||||||
@ -1121,14 +1119,13 @@ template <typename OutputIt, typename Char> class basic_format_context {
|
|||||||
internal::arg_map<basic_format_context> map_;
|
internal::arg_map<basic_format_context> map_;
|
||||||
internal::locale_ref loc_;
|
internal::locale_ref loc_;
|
||||||
|
|
||||||
basic_format_context(const basic_format_context&) = delete;
|
|
||||||
void operator=(const basic_format_context&) = delete;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using iterator = OutputIt;
|
using iterator = OutputIt;
|
||||||
using format_arg = basic_format_arg<basic_format_context>;
|
using format_arg = basic_format_arg<basic_format_context>;
|
||||||
template <typename T> using formatter_type = formatter<T, char_type>;
|
template <typename T> using formatter_type = formatter<T, char_type>;
|
||||||
|
|
||||||
|
basic_format_context(const basic_format_context&) = delete;
|
||||||
|
void operator=(const basic_format_context&) = delete;
|
||||||
/**
|
/**
|
||||||
Constructs a ``basic_format_context`` object. References to the arguments are
|
Constructs a ``basic_format_context`` object. References to the arguments are
|
||||||
stored in the object so make sure they have appropriate lifetimes.
|
stored in the object so make sure they have appropriate lifetimes.
|
||||||
|
@ -132,16 +132,15 @@ class buffered_file {
|
|||||||
explicit buffered_file(FILE* f) : file_(f) {}
|
explicit buffered_file(FILE* f) : file_(f) {}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
buffered_file(const buffered_file&) = delete;
|
||||||
|
void operator=(const buffered_file&) = delete;
|
||||||
|
|
||||||
// Constructs a buffered_file object which doesn't represent any file.
|
// Constructs a buffered_file object which doesn't represent any file.
|
||||||
buffered_file() FMT_NOEXCEPT : file_(nullptr) {}
|
buffered_file() FMT_NOEXCEPT : file_(nullptr) {}
|
||||||
|
|
||||||
// Destroys the object closing the file it represents if any.
|
// Destroys the object closing the file it represents if any.
|
||||||
FMT_API ~buffered_file() FMT_NOEXCEPT;
|
FMT_API ~buffered_file() FMT_NOEXCEPT;
|
||||||
|
|
||||||
private:
|
|
||||||
buffered_file(const buffered_file&) = delete;
|
|
||||||
void operator=(const buffered_file&) = delete;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
buffered_file(buffered_file&& other) FMT_NOEXCEPT : file_(other.file_) {
|
buffered_file(buffered_file&& other) FMT_NOEXCEPT : file_(other.file_) {
|
||||||
other.file_ = nullptr;
|
other.file_ = nullptr;
|
||||||
@ -204,11 +203,10 @@ class file {
|
|||||||
// Opens a file and constructs a file object representing this file.
|
// Opens a file and constructs a file object representing this file.
|
||||||
FMT_API file(cstring_view path, int oflag);
|
FMT_API file(cstring_view path, int oflag);
|
||||||
|
|
||||||
private:
|
public:
|
||||||
file(const file&) = delete;
|
file(const file&) = delete;
|
||||||
void operator=(const file&) = delete;
|
void operator=(const file&) = delete;
|
||||||
|
|
||||||
public:
|
|
||||||
file(file&& other) FMT_NOEXCEPT : fd_(other.fd_) { other.fd_ = -1; }
|
file(file&& other) FMT_NOEXCEPT : fd_(other.fd_) { other.fd_ = -1; }
|
||||||
|
|
||||||
file& operator=(file&& other) {
|
file& operator=(file&& other) {
|
||||||
@ -283,11 +281,10 @@ class Locale {
|
|||||||
|
|
||||||
locale_t locale_;
|
locale_t locale_;
|
||||||
|
|
||||||
Locale(const Locale&) = delete;
|
|
||||||
void operator=(const Locale&) = delete;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using type = locale_t;
|
using type = locale_t;
|
||||||
|
Locale(const Locale&) = delete;
|
||||||
|
void operator=(const Locale&) = delete;
|
||||||
|
|
||||||
Locale() : locale_(newlocale(LC_NUMERIC_MASK, "C", nullptr)) {
|
Locale() : locale_(newlocale(LC_NUMERIC_MASK, "C", nullptr)) {
|
||||||
if (!locale_) FMT_THROW(system_error(errno, "cannot create locale"));
|
if (!locale_) FMT_THROW(system_error(errno, "cannot create locale"));
|
||||||
|
Loading…
Reference in New Issue
Block a user