MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / comparsion_operator_wrap

Function comparsion_operator_wrap

extlibs/sol3/include/sol/sol.hpp:10594–10625  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10592
10593 template <typename T, typename Op>
10594 int comparsion_operator_wrap(lua_State* L) {
10595 if constexpr (std::is_void_v<T>) {
10596 return stack::push(L, false);
10597 }
10598 else {
10599 auto maybel = stack::unqualified_check_get<T>(L, 1);
10600 if (!maybel) {
10601 return stack::push(L, false);
10602 }
10603 auto mayber = stack::unqualified_check_get<T>(L, 2);
10604 if (!mayber) {
10605 return stack::push(L, false);
10606 }
10607 decltype(auto) l = *maybel;
10608 decltype(auto) r = *mayber;
10609 if constexpr (std::is_same_v<no_comp, Op>) {
10610 std::equal_to<> op;
10611 return stack::push(L, op(detail::ptr(l), detail::ptr(r)));
10612 }
10613 else {
10614 if constexpr (std::is_same_v<std::equal_to<>, Op> // clang-format hack
10615 || std::is_same_v<std::less_equal<>, Op> //
10616 || std::is_same_v<std::less_equal<>, Op>) { //
10617 if (detail::ptr(l) == detail::ptr(r)) {
10618 return stack::push(L, true);
10619 }
10620 }
10621 Op op;
10622 return stack::push(L, op(detail::deref(l), detail::deref(r)));
10623 }
10624 }
10625 }
10626
10627 template <typename T, typename IFx, typename Fx>
10628 void insert_default_registrations(IFx&& ifx, Fx&& fx);

Callers

nothing calls this directly

Calls 3

pushFunction · 0.85
derefFunction · 0.85
ptrFunction · 0.70

Tested by

no test coverage detected