Skip to content

Commit

Permalink
[libc++] Merge is_member{,_object,_function}_pointer.h (#98727)
Browse files Browse the repository at this point in the history
The implementations for these traits have been simplified quite a bit,
since we have builtins available for them now.
  • Loading branch information
philnik777 authored Jul 16, 2024
1 parent dba2e66 commit 0eebb48
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 70 deletions.
2 changes: 0 additions & 2 deletions libcxx/include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -777,8 +777,6 @@ set(files
__type_traits/is_implicitly_default_constructible.h
__type_traits/is_integral.h
__type_traits/is_literal_type.h
__type_traits/is_member_function_pointer.h
__type_traits/is_member_object_pointer.h
__type_traits/is_member_pointer.h
__type_traits/is_nothrow_assignable.h
__type_traits/is_nothrow_constructible.h
Expand Down
3 changes: 1 addition & 2 deletions libcxx/include/__type_traits/invoke.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
#include <__type_traits/integral_constant.h>
#include <__type_traits/is_base_of.h>
#include <__type_traits/is_core_convertible.h>
#include <__type_traits/is_member_function_pointer.h>
#include <__type_traits/is_member_object_pointer.h>
#include <__type_traits/is_member_pointer.h>
#include <__type_traits/is_reference_wrapper.h>
#include <__type_traits/is_same.h>
#include <__type_traits/is_void.h>
Expand Down
31 changes: 0 additions & 31 deletions libcxx/include/__type_traits/is_member_function_pointer.h

This file was deleted.

31 changes: 0 additions & 31 deletions libcxx/include/__type_traits/is_member_object_pointer.h

This file was deleted.

12 changes: 12 additions & 0 deletions libcxx/include/__type_traits/is_member_pointer.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,21 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_member_pointer : _BoolConstant<__is_member_pointer(_Tp)> {};

template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_member_object_pointer : _BoolConstant<__is_member_object_pointer(_Tp)> {};

template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_member_function_pointer : _BoolConstant<__is_member_function_pointer(_Tp)> {};

# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_member_pointer_v = __is_member_pointer(_Tp);

template <class _Tp>
inline constexpr bool is_member_object_pointer_v = __is_member_object_pointer(_Tp);

template <class _Tp>
inline constexpr bool is_member_function_pointer_v = __is_member_function_pointer(_Tp);
# endif

_LIBCPP_END_NAMESPACE_STD
Expand Down
2 changes: 0 additions & 2 deletions libcxx/include/module.modulemap
Original file line number Diff line number Diff line change
Expand Up @@ -1962,8 +1962,6 @@ module std_private_type_traits_is_fundamental [system
module std_private_type_traits_is_implicitly_default_constructible [system] { header "__type_traits/is_implicitly_default_constructible.h" }
module std_private_type_traits_is_integral [system] { header "__type_traits/is_integral.h" }
module std_private_type_traits_is_literal_type [system] { header "__type_traits/is_literal_type.h" }
module std_private_type_traits_is_member_function_pointer [system] { header "__type_traits/is_member_function_pointer.h" }
module std_private_type_traits_is_member_object_pointer [system] { header "__type_traits/is_member_object_pointer.h" }
module std_private_type_traits_is_member_pointer [system] { header "__type_traits/is_member_pointer.h" }
module std_private_type_traits_is_nothrow_assignable [system] { header "__type_traits/is_nothrow_assignable.h" }
module std_private_type_traits_is_nothrow_constructible [system] {
Expand Down
2 changes: 0 additions & 2 deletions libcxx/include/type_traits
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,6 @@ namespace std
#include <__type_traits/is_implicitly_default_constructible.h>
#include <__type_traits/is_integral.h>
#include <__type_traits/is_literal_type.h>
#include <__type_traits/is_member_function_pointer.h>
#include <__type_traits/is_member_object_pointer.h>
#include <__type_traits/is_member_pointer.h>
#include <__type_traits/is_nothrow_assignable.h>
#include <__type_traits/is_nothrow_constructible.h>
Expand Down

0 comments on commit 0eebb48

Please sign in to comment.