Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryAWE committed Feb 10, 2025
1 parent f73bdeb commit f4ba3ef
Showing 1 changed file with 8 additions and 24 deletions.
32 changes: 8 additions & 24 deletions include/asbind20/utility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,25 +89,6 @@ namespace detail

#undef ASBIND20_FUNC_TRAITS_IMPL_MEMBER

template <typename T>
concept callable_class = std::is_class_v<T>&& requires()
{
&T::operator();
};

template <typename T>
requires callable_class<T>
class func_traits_impl<T> : public func_traits_impl<decltype(&T::operator())>
{
private:
using my_base = func_traits_impl<decltype(&T::operator())>;

public:
using return_type = typename my_base::return_type;
using args_tuple = typename my_base::args_tuple;
using class_type = typename my_base::class_type;
};

template <
std::size_t Idx,
typename Tuple,
Expand Down Expand Up @@ -873,8 +854,8 @@ class [[nodiscard]] request_context
handle_type m_ctx = nullptr;
};

/*
* @brief RAII helper for managing script engine
/**
* @brief Script engine manager
*/
class script_engine
{
Expand Down Expand Up @@ -937,6 +918,9 @@ class script_engine
handle_type m_engine;
};

/**
* @brief Create an AngelScript engine
*/
inline script_engine make_script_engine(
AS_NAMESPACE_QUALIFIER asDWORD version = ANGELSCRIPT_VERSION
)
Expand Down Expand Up @@ -1089,7 +1073,7 @@ constexpr std::string_view static_enum_name() noexcept
* @note This function is implemented by undefined behavior but is expected to work on most platforms
*/
template <typename T, typename Class>
std::size_t member_offset(T Class::*mp) noexcept
std::size_t member_offset(T Class::* mp) noexcept
{
Class* p = nullptr;
return std::size_t(std::addressof(p->*mp)) - std::size_t(p);
Expand Down Expand Up @@ -1150,7 +1134,7 @@ concept has_static_name =
std::is_arithmetic_v<T> &&
!std::same_as<T, char>;

inline auto get_default_factory(asITypeInfo* ti)
inline auto get_default_factory(AS_NAMESPACE_QUALIFIER asITypeInfo* ti)
-> AS_NAMESPACE_QUALIFIER asIScriptFunction*
{
assert(ti != nullptr);
Expand All @@ -1166,7 +1150,7 @@ inline auto get_default_factory(asITypeInfo* ti)
return nullptr;
}

inline auto get_default_constructor(asITypeInfo* ti)
inline auto get_default_constructor(AS_NAMESPACE_QUALIFIER asITypeInfo* ti)
-> AS_NAMESPACE_QUALIFIER asIScriptFunction*
{
assert(ti != nullptr);
Expand Down

0 comments on commit f4ba3ef

Please sign in to comment.