Enums::f(): Accept CStringView instead of std::string&
MODIFY
include/vcpkg_Enums.h
include/vcpkg_Enums.h
namespace vcpkg::Enums
{
- std::string nullvalue_to_string(const std::string& enum_name);
+ std::string nullvalue_to_string(const CStringView enum_name);
- [[noreturn]] void nullvalue_used(const LineInfo& line_info, const std::string& enum_name);
+ [[noreturn]] void nullvalue_used(const LineInfo& line_info, const CStringView enum_name);
}

MODIFY
src/vcpkg_Enums.cpp
src/vcpkg_Enums.cpp
namespace vcpkg::Enums
{
- std::string nullvalue_to_string(const std::string& enum_name) { return Strings::format("%s_NULLVALUE", enum_name); }
+ std::string nullvalue_to_string(const CStringView enum_name) { return Strings::format("%s_NULLVALUE", enum_name); }
- [[noreturn]] void nullvalue_used(const LineInfo& line_info, const std::string& enum_name)
+ [[noreturn]] void nullvalue_used(const LineInfo& line_info, const CStringView enum_name)
{
Checks::exit_with_message(line_info, "NULLVALUE of enum %s was used", enum_name);
}

Enums::f(): Accept CStringView instead of std::string&