mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 04:43:10 +00:00
Mark trivial constructors/destructors as default
This commit is contained in:
parent
da84b38430
commit
51c9ad1359
8 changed files with 15 additions and 15 deletions
|
@ -185,7 +185,7 @@ ParserError::ParserError(const char_type *szMsg, int iPos, string_type sTok)
|
|||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
ParserError::~ParserError() {}
|
||||
ParserError::~ParserError() = default;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief Replace all occurrences of a substring with another string.
|
||||
|
|
|
@ -685,7 +685,7 @@ class string_matcher_t {
|
|||
string_matcher_t(options_t opts_, io_streams_t &streams_)
|
||||
: opts(std::move(opts_)), streams(streams_), total_matched(0) {}
|
||||
|
||||
virtual ~string_matcher_t() {}
|
||||
virtual ~string_matcher_t() = default;
|
||||
virtual bool report_matches(const wchar_t *arg) = 0;
|
||||
int match_count() { return total_matched; }
|
||||
};
|
||||
|
@ -709,7 +709,7 @@ class wildcard_matcher_t : public string_matcher_t {
|
|||
}
|
||||
}
|
||||
|
||||
virtual ~wildcard_matcher_t() {}
|
||||
virtual ~wildcard_matcher_t() = default;
|
||||
|
||||
bool report_matches(const wchar_t *arg) {
|
||||
// Note: --all is a no-op for glob matching since the pattern is always matched
|
||||
|
@ -849,7 +849,7 @@ class pcre2_matcher_t : public string_matcher_t {
|
|||
argv0(argv0_),
|
||||
regex(argv0_, pattern, opts.ignore_case, streams) {}
|
||||
|
||||
virtual ~pcre2_matcher_t() {}
|
||||
virtual ~pcre2_matcher_t() = default;
|
||||
|
||||
bool report_matches(const wchar_t *arg) {
|
||||
// A return value of true means all is well (even if no matches were found), false indicates
|
||||
|
@ -959,7 +959,7 @@ class string_replacer_t {
|
|||
string_replacer_t(const wchar_t *argv0_, options_t opts_, io_streams_t &streams_)
|
||||
: argv0(argv0_), opts(std::move(opts_)), total_replaced(0), streams(streams_) {}
|
||||
|
||||
virtual ~string_replacer_t() {}
|
||||
virtual ~string_replacer_t() = default;
|
||||
int replace_count() { return total_replaced; }
|
||||
virtual bool replace_matches(const wchar_t *arg) = 0;
|
||||
};
|
||||
|
@ -977,7 +977,7 @@ class literal_replacer_t : public string_replacer_t {
|
|||
replacement(replacement_),
|
||||
patlen(wcslen(pattern)) {}
|
||||
|
||||
virtual ~literal_replacer_t() {}
|
||||
virtual ~literal_replacer_t() = default;
|
||||
bool replace_matches(const wchar_t *arg);
|
||||
};
|
||||
|
||||
|
|
|
@ -190,7 +190,7 @@ class expression {
|
|||
const token_t token;
|
||||
range_t range;
|
||||
|
||||
virtual ~expression() {}
|
||||
virtual ~expression() = default;
|
||||
|
||||
/// Evaluate returns true if the expression is true (i.e. STATUS_CMD_OK).
|
||||
virtual bool evaluate(wcstring_list_t &errors) = 0;
|
||||
|
@ -239,7 +239,7 @@ class combining_expression : public expression {
|
|||
assert(subjects.size() == combiners.size() + 1);
|
||||
}
|
||||
|
||||
virtual ~combining_expression() {}
|
||||
virtual ~combining_expression() = default;
|
||||
|
||||
bool evaluate(wcstring_list_t &errors);
|
||||
};
|
||||
|
|
|
@ -1367,9 +1367,9 @@ std::unique_ptr<universal_notifier_t> universal_notifier_t::new_notifier_for_str
|
|||
}
|
||||
|
||||
// Default implementations.
|
||||
universal_notifier_t::universal_notifier_t() {}
|
||||
universal_notifier_t::universal_notifier_t() = default;
|
||||
|
||||
universal_notifier_t::~universal_notifier_t() {}
|
||||
universal_notifier_t::~universal_notifier_t() = default;
|
||||
|
||||
int universal_notifier_t::notification_fd() { return -1; }
|
||||
|
||||
|
|
|
@ -459,7 +459,7 @@ void event_fire_generic(const wchar_t *name, wcstring_list_t *args) {
|
|||
|
||||
event_t::event_t(int t) : type(t), param1(), str_param1(), function_name(), arguments() {}
|
||||
|
||||
event_t::~event_t() {}
|
||||
event_t::~event_t() = default;
|
||||
|
||||
event_t event_t::signal_event(int sig) {
|
||||
event_t event(EVENT_SIGNAL);
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include "io.h"
|
||||
#include "wutil.h" // IWYU pragma: keep
|
||||
|
||||
io_data_t::~io_data_t() {}
|
||||
io_data_t::~io_data_t() = default;
|
||||
|
||||
void io_close_t::print() const { fwprintf(stderr, L"close %d\n", fd); }
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ class maybe_t {
|
|||
explicit operator bool() const { return filled; }
|
||||
|
||||
// The default constructor constructs a maybe with no value.
|
||||
maybe_t() {}
|
||||
maybe_t() = default;
|
||||
|
||||
// Construct a maybe_t from a none_t
|
||||
/* implicit */ maybe_t(none_t n) { (void)n; }
|
||||
|
|
|
@ -103,7 +103,7 @@ static wcstring user_presentable_path(const wcstring &path) {
|
|||
parser_t::parser_t() : cancellation_requested(false), is_within_fish_initialization(false) {}
|
||||
|
||||
// Out of line destructor to enable forward declaration of parse_execution_context_t
|
||||
parser_t::~parser_t() {}
|
||||
parser_t::~parser_t() = default;
|
||||
|
||||
static parser_t s_principal_parser;
|
||||
|
||||
|
@ -788,7 +788,7 @@ void parser_t::get_backtrace(const wcstring &src, const parse_error_list_t &erro
|
|||
|
||||
block_t::block_t(block_type_t t) : block_type(t) {}
|
||||
|
||||
block_t::~block_t() {}
|
||||
block_t::~block_t() = default;
|
||||
|
||||
wcstring block_t::description() const {
|
||||
wcstring result;
|
||||
|
|
Loading…
Reference in a new issue