Skip to content

Commit

Permalink
feat: remove stl::to_underlying, use std::to_underlying
Browse files Browse the repository at this point in the history
  • Loading branch information
qudix committed Sep 22, 2024
1 parent eff49e2 commit ec59b6f
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion include/RE/B/BGSDefaultObjectManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ namespace RE
[[nodiscard]] TESForm* GetDefaultObject(DEFAULT_OBJECT a_obj) const noexcept
{
assert(a_obj < DEFAULT_OBJECT::kTotal);
return objectArray[stl::to_underlying(a_obj)];
return objectArray[std::to_underlying(a_obj)];
}

template <class T>
Expand Down
2 changes: 1 addition & 1 deletion include/RE/T/TESDataHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ namespace RE
std::uint64_t unk0058; // 0058
std::uint64_t unk0060; // 0060
std::uint64_t unk0068; // 0068
FormArray formArrays[stl::to_underlying(FormType::kTotal)]; // 0070
FormArray formArrays[std::to_underlying(FormType::kTotal)]; // 0070
TESRegionList* regionList; // 1498
std::uint64_t unk14A0; // 14A0
std::uint64_t unk14A8; // 14A8
Expand Down
7 changes: 0 additions & 7 deletions include/SFSE/Impl/PCH.h
Original file line number Diff line number Diff line change
Expand Up @@ -481,13 +481,6 @@ namespace SFSE::stl
std::unreachable();
}

template <class Enum>
[[nodiscard]] constexpr auto to_underlying(Enum a_val) noexcept
requires(std::is_enum_v<Enum>)
{
return static_cast<std::underlying_type_t<Enum>>(a_val);
}

template <class To, class From>
[[nodiscard]] To unrestricted_cast(From a_from) noexcept
{
Expand Down
2 changes: 1 addition & 1 deletion src/RE/F/FormTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace RE
{
const char* FormTypeToString(FormType a_formType)
{
return FORM_ENUM_STRING::GetFormEnumString()[stl::to_underlying(a_formType)].formString;
return FORM_ENUM_STRING::GetFormEnumString()[std::to_underlying(a_formType)].formString;
}

FormType StringToFormType(std::string_view a_formType)
Expand Down

0 comments on commit ec59b6f

Please sign in to comment.