Changeset 8f8f1d1e in mainline
- Timestamp:
- 2018-07-05T21:41:23Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f6f636f
- Parents:
- 0e5e8bf9
- git-author:
- Dzejrou <dzejrou@…> (2018-05-12 17:12:15)
- git-committer:
- Dzejrou <dzejrou@…> (2018-07-05 21:41:23)
- Location:
- uspace/lib/cpp/include/internal/functional
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/cpp/include/internal/functional/hash.hpp
r0e5e8bf9 r8f8f1d1e 30 30 #define LIBCPP_INTERNAL_FUNCTIONAL_HASH 31 31 32 #include <cstdlib> 33 32 34 namespace std 33 35 { 36 template<class> 37 struct is_arithmetic; 38 39 template<class> 40 struct is_pointer; 41 34 42 /** 35 43 * 20.9.13, hash function primary template: … … 64 72 size_t hash(T x) noexcept 65 73 { 66 static_assert(is_arithmetic _v<T> || is_pointer_v<T>,74 static_assert(is_arithmetic<T>::value || is_pointer<T>::value, 67 75 "invalid type passed to aux::hash"); 68 76 -
uspace/lib/cpp/include/internal/functional/invoke.hpp
r0e5e8bf9 r8f8f1d1e 32 32 #include <internal/utility/declval.hpp> 33 33 #include <internal/utility/forward_move.hpp> 34 #include <type_traits> 34 35 namespace std 36 { 37 template<class> 38 struct is_member_function_pointer; 39 40 template<class, class> 41 struct is_base_of; 42 43 template<class> 44 struct is_member_object_pointer; 45 } 35 46 36 47 namespace std::aux … … 43 54 decltype(auto) invoke(R T::* f, T1&& t1, Ts&&... args) 44 55 { 45 if constexpr (is_member_function_pointer _v<decltype(f)>)56 if constexpr (is_member_function_pointer<decltype(f)>::value) 46 57 { 47 if constexpr (is_base_of _v<T, remove_reference_t<T1>>)58 if constexpr (is_base_of<T, remove_reference_t<T1>>::value) 48 59 // (1.1) 49 60 return (t1.*f)(forward<Ts>(args)...); … … 52 63 return ((*t1).*f)(forward<Ts>(args)...); 53 64 } 54 else if constexpr (is_member_object_pointer _v<decltype(f)>&& sizeof...(args) == 0)65 else if constexpr (is_member_object_pointer<decltype(f)>::value && sizeof...(args) == 0) 55 66 { 56 67 /** … … 58 69 * so we need sizeof...(args) to be 0. 59 70 */ 60 if constexpr (is_base_of _v<T, remove_reference_t<T1>>)71 if constexpr (is_base_of<T, remove_reference_t<T1>>::value) 61 72 // (1.3) 62 73 return t1.*f; … … 73 84 * so we use this because we know it is false here. 74 85 */ 75 static_assert(is_member_function_pointer _v<decltype(f)>, "invalid invoke");86 static_assert(is_member_function_pointer<decltype(f)>::value, "invalid invoke"); 76 87 } 77 88
Note:
See TracChangeset
for help on using the changeset viewer.