diff options
author | Brad King <brad.king@kitware.com> | 2022-06-29 19:41:22 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-07-05 20:35:01 (GMT) |
commit | f3dbf4b89d4e74d30fae9e7696caef4158c707e5 (patch) | |
tree | 02dcf5bd2bc0c9d93d1c85d18a4a8f9d9eedebbe | |
parent | 2873f41bd9f3636f53abf9c31a0b7492366c5199 (diff) | |
download | CMake-f3dbf4b89d4e74d30fae9e7696caef4158c707e5.zip CMake-f3dbf4b89d4e74d30fae9e7696caef4158c707e5.tar.gz CMake-f3dbf4b89d4e74d30fae9e7696caef4158c707e5.tar.bz2 |
cmArgumentParser: Remove unnecessary local names for common types
-rw-r--r-- | Source/cmArgumentParser.cxx | 4 | ||||
-rw-r--r-- | Source/cmArgumentParser.h | 9 |
2 files changed, 5 insertions, 8 deletions
diff --git a/Source/cmArgumentParser.cxx b/Source/cmArgumentParser.cxx index bc91b01..1a05dbc 100644 --- a/Source/cmArgumentParser.cxx +++ b/Source/cmArgumentParser.cxx @@ -44,14 +44,14 @@ void Instance::Bind(std::string& val) this->ExpectValue = true; } -void Instance::Bind(StringList& val) +void Instance::Bind(std::vector<std::string>& val) { this->CurrentString = nullptr; this->CurrentList = &val; this->ExpectValue = true; } -void Instance::Bind(MultiStringList& val) +void Instance::Bind(std::vector<std::vector<std::string>>& val) { this->CurrentString = nullptr; this->CurrentList = (static_cast<void>(val.emplace_back()), &val.back()); diff --git a/Source/cmArgumentParser.h b/Source/cmArgumentParser.h index aa6cf75..2120a27 100644 --- a/Source/cmArgumentParser.h +++ b/Source/cmArgumentParser.h @@ -15,9 +15,6 @@ namespace ArgumentParser { -using StringList = std::vector<std::string>; -using MultiStringList = std::vector<StringList>; - class Instance; using Action = std::function<void(Instance&, void*)>; @@ -39,8 +36,8 @@ public: void Bind(bool& val); void Bind(std::string& val); - void Bind(StringList& val); - void Bind(MultiStringList& val); + void Bind(std::vector<std::string>& val); + void Bind(std::vector<std::vector<std::string>>& val); void Consume(cm::string_view arg, void* result, std::vector<std::string>* unparsedArguments, @@ -50,7 +47,7 @@ public: private: ActionMap const& Bindings; std::string* CurrentString = nullptr; - StringList* CurrentList = nullptr; + std::vector<std::string>* CurrentList = nullptr; bool ExpectValue = false; }; |