Skip to content

Commit

Permalink
Replace lambda in SetMethods with holds_alternative
Browse files Browse the repository at this point in the history
  • Loading branch information
Foereaper committed Aug 5, 2024
1 parent a2bee45 commit df442f3
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions ElunaTemplate.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,14 +284,8 @@ class ElunaTemplate
ASSERT(methodTable);

// determine if the method table functions are global or non-global
bool isGlobal = false;
const auto& firstMethod = methodTable[0];
std::visit([&isGlobal](auto&& func)
{
using FuncType = std::decay_t<decltype(func)>;
if constexpr (std::is_same_v<FuncType, int(*)(Eluna*)>)
isGlobal = true;
}, firstMethod.mfunc);
bool isGlobal = std::holds_alternative<int(*)(Eluna*)>(firstMethod.mfunc);

if (isGlobal)
{
Expand Down

0 comments on commit df442f3

Please sign in to comment.