stl: std::is_member_pointer_v
This commit is contained in:
@@ -831,7 +831,7 @@ using constness_as_t = constness_as<To, From>::type;
|
||||
*/
|
||||
template<typename Member>
|
||||
class member_class {
|
||||
static_assert(std::is_member_pointer_v<Member>, "Invalid pointer type to non-static member object or function");
|
||||
static_assert(stl::is_member_pointer_v<Member>, "Invalid pointer type to non-static member object or function");
|
||||
|
||||
template<typename Class, typename Ret, typename... Args>
|
||||
static Class *clazz(Ret (Class::*)(Args...));
|
||||
|
||||
@@ -316,7 +316,7 @@ template<typename Type, auto Data>
|
||||
*/
|
||||
template<typename Type, auto Data, meta_policy Policy = as_value_t>
|
||||
[[nodiscard]] meta_any meta_getter(meta_handle instance) {
|
||||
if constexpr(std::is_member_pointer_v<decltype(Data)> || stl::is_function_v<stl::remove_reference_t<stl::remove_pointer_t<decltype(Data)>>>) {
|
||||
if constexpr(stl::is_member_pointer_v<decltype(Data)> || stl::is_function_v<stl::remove_reference_t<stl::remove_pointer_t<decltype(Data)>>>) {
|
||||
if constexpr(!stl::is_array_v<stl::remove_cvref_t<stl::invoke_result_t<decltype(Data), Type &>>>) {
|
||||
if constexpr(stl::is_invocable_v<decltype(Data), Type &>) {
|
||||
if(auto *clazz = instance->try_cast<Type>(); clazz) {
|
||||
|
||||
@@ -141,7 +141,7 @@ public:
|
||||
fn = [](const void *, Args... args) -> return_type {
|
||||
return Ret(std::invoke(Candidate, stl::forward<Args>(args)...));
|
||||
};
|
||||
} else if constexpr(std::is_member_pointer_v<decltype(Candidate)>) {
|
||||
} else if constexpr(stl::is_member_pointer_v<decltype(Candidate)>) {
|
||||
fn = wrap<Candidate>(internal::index_sequence_for<type_list_element_t<0, type_list<Args...>>>(internal::function_pointer_t<decltype(Candidate)>{}));
|
||||
} else {
|
||||
fn = wrap<Candidate>(internal::index_sequence_for(internal::function_pointer_t<decltype(Candidate)>{}));
|
||||
|
||||
@@ -32,6 +32,7 @@ using std::is_invocable_r_v;
|
||||
using std::is_invocable_v;
|
||||
using std::is_lvalue_reference_v;
|
||||
using std::is_member_object_pointer_v;
|
||||
using std::is_member_pointer_v;
|
||||
using std::is_move_assignable_v;
|
||||
using std::is_nothrow_constructible_v;
|
||||
using std::is_nothrow_copy_constructible_v;
|
||||
|
||||
Reference in New Issue
Block a user