[Triplet] Naming convention and missing const
MODIFY
include/triplet.h
include/triplet.h
@@ -9,7 +9,7 @@ namespace vcpkg
struct Triplet
{
public:
- constexpr Triplet() : m_instance(&default_instance) {}
+ constexpr Triplet() : m_instance(&DEFAULT_INSTANCE) {}
static Triplet from_canonical_name(const std::string& triplet_as_string);
@@ -26,7 +26,7 @@ namespace vcpkg
bool operator==(const Triplet& other) const;
private:
- static const TripletInstance default_instance;
+ static const TripletInstance DEFAULT_INSTANCE;
constexpr Triplet(const TripletInstance* ptr) : m_instance(ptr) {}

MODIFY
src/triplet.cpp
src/triplet.cpp
@@ -15,7 +15,7 @@ namespace vcpkg
bool operator==(const TripletInstance& o) const { return o.value == value; }
};
- const TripletInstance Triplet::default_instance({});
+ const TripletInstance Triplet::DEFAULT_INSTANCE({});
}
template<>
@@ -41,10 +41,10 @@ namespace vcpkg
Triplet Triplet::from_canonical_name(const std::string& triplet_as_string)
{
std::string s(Strings::ascii_to_lowercase(triplet_as_string));
- auto it = std::find(s.cbegin(), s.cend(), '-');
+ const auto it = std::find(s.cbegin(), s.cend(), '-');
Checks::check_exit(VCPKG_LINE_INFO, it != s.cend(), "Invalid triplet: %s", triplet_as_string);
- auto p = g_triplet_instances.emplace(std::move(s));
+ const auto p = g_triplet_instances.emplace(std::move(s));
return &*p.first;
}

[Triplet] Naming convention and missing const