diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2018-01-17 19:39:46 -0800 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2018-01-17 19:39:46 -0800 |
| commit | f563d2b58849d8ae6a04be0ad531cb2e20313fe0 (patch) | |
| tree | 1d07e985214ed26f2b821131d1789d9303ebb154 /toolsrc/include | |
| parent | 458dafc812a1bc4f3290397601457e93f53b2dea (diff) | |
| download | vcpkg-f563d2b58849d8ae6a04be0ad531cb2e20313fe0.tar.gz vcpkg-f563d2b58849d8ae6a04be0ad531cb2e20313fe0.zip | |
Use StringLiteral and constexpr for options/switches
Diffstat (limited to 'toolsrc/include')
| -rw-r--r-- | toolsrc/include/vcpkg/vcpkgcmdarguments.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/toolsrc/include/vcpkg/vcpkgcmdarguments.h b/toolsrc/include/vcpkg/vcpkgcmdarguments.h index 93eeb6ef5..d84be9c22 100644 --- a/toolsrc/include/vcpkg/vcpkgcmdarguments.h +++ b/toolsrc/include/vcpkg/vcpkgcmdarguments.h @@ -3,6 +3,7 @@ #include <vcpkg/base/cstringview.h> #include <vcpkg/base/optional.h> #include <vcpkg/base/span.h> +#include <vcpkg/base/stringliteral.h> #include <memory> #include <unordered_map> @@ -21,14 +22,24 @@ namespace vcpkg struct CommandSwitch { - std::string name; - CStringView short_help_text; + constexpr CommandSwitch(const StringLiteral& name, const StringLiteral& short_help_text) + : name(name), short_help_text(short_help_text) + { + } + + StringLiteral name; + StringLiteral short_help_text; }; struct CommandSetting { - std::string name; - CStringView short_help_text; + constexpr CommandSetting(const StringLiteral& name, const StringLiteral& short_help_text) + : name(name), short_help_text(short_help_text) + { + } + + StringLiteral name; + StringLiteral short_help_text; }; struct CommandOptionsStructure |
