From f3dbf4b89d4e74d30fae9e7696caef4158c707e5 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 29 Jun 2022 15:41:22 -0400 Subject: cmArgumentParser: Remove unnecessary local names for common types --- Source/cmArgumentParser.cxx | 4 ++-- 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& val) { this->CurrentString = nullptr; this->CurrentList = &val; this->ExpectValue = true; } -void Instance::Bind(MultiStringList& val) +void Instance::Bind(std::vector>& val) { this->CurrentString = nullptr; this->CurrentList = (static_cast(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; -using MultiStringList = std::vector; - class Instance; using Action = std::function; @@ -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& val); + void Bind(std::vector>& val); void Consume(cm::string_view arg, void* result, std::vector* unparsedArguments, @@ -50,7 +47,7 @@ public: private: ActionMap const& Bindings; std::string* CurrentString = nullptr; - StringList* CurrentList = nullptr; + std::vector* CurrentList = nullptr; bool ExpectValue = false; }; -- cgit v0.12