From ef0bdb00e4f671ea3c5d1bf096d230b57b526d96 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 25 Apr 2017 17:39:59 -0700 Subject: Rework ConfigurationType enum --- toolsrc/include/PostBuildLint_ConfigurationType.h | 33 ++++++++++++----------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'toolsrc/include/PostBuildLint_ConfigurationType.h') diff --git a/toolsrc/include/PostBuildLint_ConfigurationType.h b/toolsrc/include/PostBuildLint_ConfigurationType.h index 1ce63690f..710547b85 100644 --- a/toolsrc/include/PostBuildLint_ConfigurationType.h +++ b/toolsrc/include/PostBuildLint_ConfigurationType.h @@ -2,19 +2,19 @@ #pragma once #include -namespace vcpkg::PostBuildLint::ConfigurationType +namespace vcpkg::PostBuildLint { - enum class BackingEnum + struct ConfigurationType { - NULLVALUE = 0, - DEBUG = 1, - RELEASE = 2 - }; + enum class BackingEnum + { + NULLVALUE = 0, + DEBUG = 1, + RELEASE = 2 + }; - struct Type - { - constexpr Type() : backing_enum(BackingEnum::NULLVALUE) {} - constexpr explicit Type(BackingEnum backing_enum) : backing_enum(backing_enum) { } + constexpr ConfigurationType() : backing_enum(BackingEnum::NULLVALUE) {} + constexpr explicit ConfigurationType(BackingEnum backing_enum) : backing_enum(backing_enum) { } constexpr operator BackingEnum() const { return backing_enum; } const std::string& to_string() const; @@ -23,11 +23,14 @@ namespace vcpkg::PostBuildLint::ConfigurationType BackingEnum backing_enum; }; - static const std::string ENUM_NAME = "vcpkg::PostBuildLint::ConfigurationType"; + namespace ConfigurationTypeC + { + static constexpr const char* ENUM_NAME = "vcpkg::PostBuildLint::ConfigurationType"; - static constexpr Type NULLVALUE(BackingEnum::NULLVALUE); - static constexpr Type DEBUG(BackingEnum::DEBUG); - static constexpr Type RELEASE(BackingEnum::RELEASE); + static constexpr ConfigurationType NULLVALUE(ConfigurationType::BackingEnum::NULLVALUE); + static constexpr ConfigurationType DEBUG(ConfigurationType::BackingEnum::DEBUG); + static constexpr ConfigurationType RELEASE(ConfigurationType::BackingEnum::RELEASE); - static constexpr std::array values = { DEBUG, RELEASE }; + static constexpr std::array VALUES = { DEBUG, RELEASE }; + } } -- cgit v1.2.3