diff options
author | Vito Gamberini <vito.gamberini@kitware.com> | 2024-06-29 03:07:07 (GMT) |
---|---|---|
committer | Vito Gamberini <vito.gamberini@kitware.com> | 2024-07-02 13:30:55 (GMT) |
commit | e0f9d81f099adfb0ec41c92dd8c359aa0f2ac60c (patch) | |
tree | 25b003cd0e88ad52591a6bc5bef7f95186274b9e /Utilities | |
parent | 73f368b3c1b85d5e2abe2ad49f6e856b69600a39 (diff) | |
download | CMake-e0f9d81f099adfb0ec41c92dd8c359aa0f2ac60c.zip CMake-e0f9d81f099adfb0ec41c92dd8c359aa0f2ac60c.tar.gz CMake-e0f9d81f099adfb0ec41c92dd8c359aa0f2ac60c.tar.bz2 |
STL: extend type_traits to deal with member pointers
Diffstat (limited to 'Utilities')
-rw-r--r-- | Utilities/std/cmext/type_traits | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Utilities/std/cmext/type_traits b/Utilities/std/cmext/type_traits index 4468e31..57e1e01 100644 --- a/Utilities/std/cmext/type_traits +++ b/Utilities/std/cmext/type_traits @@ -82,4 +82,30 @@ using is_sequence_container = !cm::is_associative_container<T>::value && !cm::is_unordered_associative_container<T>::value>; +template <typename T> +struct remove_member_pointer +{ + typedef T type; +}; +template <typename T, typename U> +struct remove_member_pointer<T U::*> +{ + typedef T type; +}; +template <typename T> +using remove_member_pointer_t = typename remove_member_pointer<T>::type; + +template <typename T> +struct member_pointer_class +{ + typedef T type; +}; +template <typename T, typename U> +struct member_pointer_class<U T::*> +{ + typedef T type; +}; +template <typename T> +using member_pointer_class_t = typename member_pointer_class<T>::type; + } // namespace cm |