From f563d2b58849d8ae6a04be0ad531cb2e20313fe0 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 17 Jan 2018 19:39:46 -0800 Subject: Use StringLiteral and constexpr for options/switches --- toolsrc/include/vcpkg/vcpkgcmdarguments.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'toolsrc/include') 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 #include #include +#include #include #include @@ -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 -- cgit v1.2.3