From 8f21748bf127012947ed48c40948df3f2d9c85ef Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Wed, 14 Jul 2021 17:16:36 +0100 Subject: Mark move constructors/assignements as `noexcept`. And unmark `HashSet` copy constructor and copy assignment. Test: m Change-Id: Ia419f3036b2880815be446395e81c7e543388bd9 --- cmdline/cmdline_parse_result.h | 2 +- cmdline/cmdline_parser.h | 8 ++++---- cmdline/cmdline_types.h | 4 ++-- cmdline/detail/cmdline_parse_argument_detail.h | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'cmdline') 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&& 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 list_; @@ -457,7 +457,7 @@ struct ParseStringList : public ParseList { ParseStringList() = default; ParseStringList(const ParseStringList&) = default; - ParseStringList(ParseStringList&&) = default; + ParseStringList(ParseStringList&&) noexcept = default; }; template 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. -- cgit v1.2.3-59-g8ed1b