summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2021-07-14 17:16:36 +0100
committer Vladimir Marko <vmarko@google.com> 2021-07-16 09:44:43 +0000
commit8f21748bf127012947ed48c40948df3f2d9c85ef (patch)
tree70d287634fd0b3a2d43ad8de7738c9703eb0a2a6 /cmdline
parentce5c830aede3313ceb22f7b2ca6c30e5b8432972 (diff)
Mark move constructors/assignements as `noexcept`.
And unmark `HashSet` copy constructor and copy assignment. Test: m Change-Id: Ia419f3036b2880815be446395e81c7e543388bd9
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/cmdline_parse_result.h2
-rw-r--r--cmdline/cmdline_parser.h8
-rw-r--r--cmdline/cmdline_types.h4
-rw-r--r--cmdline/detail/cmdline_parse_argument_detail.h2
4 files changed, 8 insertions, 8 deletions
diff --git a/cmdline/cmdline_parse_result.h b/cmdline/cmdline_parse_result.h
index 982f17866d..95dc14ae19 100644
--- a/cmdline/cmdline_parse_result.h
+++ b/cmdline/cmdline_parse_result.h
@@ -119,7 +119,7 @@ struct CmdlineParseResult : CmdlineResult {
// Make sure copying is allowed
CmdlineParseResult(const CmdlineParseResult&) = default;
// Make sure moving is cheap
- CmdlineParseResult(CmdlineParseResult&&) = default;
+ CmdlineParseResult(CmdlineParseResult&&) noexcept = default;
private:
explicit CmdlineParseResult(const T& value)
diff --git a/cmdline/cmdline_parser.h b/cmdline/cmdline_parser.h
index 7e343f8ef2..5cdf446474 100644
--- a/cmdline/cmdline_parser.h
+++ b/cmdline/cmdline_parser.h
@@ -229,7 +229,7 @@ struct CmdlineParser {
}
// Ensure we always move this when returning a new builder.
- ArgumentBuilder(ArgumentBuilder&&) = default;
+ ArgumentBuilder(ArgumentBuilder&&) noexcept = default;
protected:
// Used by builder to internally ignore arguments by dropping them on the floor after parsing.
@@ -372,7 +372,7 @@ struct CmdlineParser {
}
// Ensure we always move this when returning a new builder.
- UntypedArgumentBuilder(UntypedArgumentBuilder&&) = default;
+ UntypedArgumentBuilder(UntypedArgumentBuilder&&) noexcept = default;
protected:
void SetNames(std::vector<const char*>&& names) {
@@ -590,9 +590,9 @@ struct CmdlineParser {
}
// Ensure we have a default move constructor.
- CmdlineParser(CmdlineParser&&) = default;
+ CmdlineParser(CmdlineParser&&) noexcept = default;
// Ensure we have a default move assignment operator.
- CmdlineParser& operator=(CmdlineParser&&) = default;
+ CmdlineParser& operator=(CmdlineParser&&) noexcept = default;
private:
friend struct Builder;
diff --git a/cmdline/cmdline_types.h b/cmdline/cmdline_types.h
index 964e2385b6..dc2f8b75bb 100644
--- a/cmdline/cmdline_types.h
+++ b/cmdline/cmdline_types.h
@@ -436,7 +436,7 @@ struct ParseList {
ParseList() = default;
ParseList(const ParseList&) = default;
- ParseList(ParseList&&) = default;
+ ParseList(ParseList&&) noexcept = default;
private:
std::vector<ArgType> list_;
@@ -457,7 +457,7 @@ struct ParseStringList : public ParseList<std::string, Separator> {
ParseStringList() = default;
ParseStringList(const ParseStringList&) = default;
- ParseStringList(ParseStringList&&) = default;
+ ParseStringList(ParseStringList&&) noexcept = default;
};
template <char Separator>
diff --git a/cmdline/detail/cmdline_parse_argument_detail.h b/cmdline/detail/cmdline_parse_argument_detail.h
index 0f73a76b72..95883cce38 100644
--- a/cmdline/detail/cmdline_parse_argument_detail.h
+++ b/cmdline/detail/cmdline_parse_argument_detail.h
@@ -339,7 +339,7 @@ struct CmdlineParserArgumentInfo {
CmdlineParserArgumentInfo() = default;
// Ensure there's a default move constructor.
- CmdlineParserArgumentInfo(CmdlineParserArgumentInfo&&) = default;
+ CmdlineParserArgumentInfo(CmdlineParserArgumentInfo&&) noexcept = default;
private:
// Perform type-specific checks at runtime.