Add BuildPolicies::values()
MODIFY
include/BuildPolicies.h
include/BuildPolicies.h
@@ -11,7 +11,6 @@ namespace vcpkg::PostBuildLint::BuildPolicies
struct type
{
- static constexpr int length() { return 2; }
constexpr explicit type(backing_enum_t backing_enum) : backing_enum(backing_enum) { }
constexpr operator backing_enum_t() const { return backing_enum; }
@@ -23,6 +22,9 @@ namespace vcpkg::PostBuildLint::BuildPolicies
backing_enum_t backing_enum;
};
+ static constexpr int value_count = 2;
+ const std::vector<type>& values();
+
static constexpr type UNKNOWN(backing_enum_t::UNKNOWN);
static constexpr type DLLS_WITHOUT_LIBS(backing_enum_t::DLLS_WITHOUT_LIBS);

MODIFY
src/BuildPolicies.cpp
src/BuildPolicies.cpp
@@ -37,6 +37,12 @@ namespace vcpkg::PostBuildLint::BuildPolicies
type::type(): backing_enum(backing_enum_t::UNKNOWN) {}
+ const std::vector<type>& values()
+ {
+ static const std::vector<type>& v = {UNKNOWN, DLLS_WITHOUT_LIBS};
+ return v;
+ }
+
type parse(const std::string& s)
{
if (s == NAME_DLLS_WITHOUT_LIBS)

Add BuildPolicies::values()