Changeset 7e7c1aac in mainline
- Timestamp:
- 2018-07-05T21:41:20Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 40340461
- Parents:
- 9283830
- git-author:
- Dzejrou <dzejrou@…> (2018-03-28 14:22:16)
- git-committer:
- Dzejrou <dzejrou@…> (2018-07-05 21:41:20)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/cpp/include/impl/type_traits.hpp
r9283830 r7e7c1aac 36 36 namespace std 37 37 { 38 template<class T> 39 struct add_rvalue_reference; 40 41 template<class T> 42 using add_rvalue_reference_t = typename add_rvalue_reference<T>::type; 43 44 template<class T> 45 add_rvalue_reference_t<T> declval() noexcept; 46 38 47 /** 39 48 * 20.10.3, helper class: … … 61 70 using true_type = integral_constant<bool, true>; 62 71 using false_type = integral_constant<bool, false>; 72 73 template<class...> 74 using void_t = void; 63 75 64 76 template<class> … … 782 794 inline constexpr bool is_base_of_v = is_base_of<Base, Derived>::value; 783 795 796 template<class From, class To, class = void> 797 struct is_convertible: false_type 798 { /* DUMMY BODY */ }; 799 784 800 template<class From, class To> 785 struct is_convertible; 801 struct is_convertible<From, To, void_t<decltype((To)declval<From>())>> 802 : true_type 803 { /* DUMMY BODY */ }; 804 805 template<class From, class To> 806 inline constexpr bool is_convertible_v = is_convertible<From, To>::value; 786 807 787 808 /** … … 867 888 { /* DUMMY BODY */ }; 868 889 869 template<class T> 870 struct add_lvalue_reference; 890 // TODO: is this good? 891 template<class T> 892 struct add_lvalue_reference: aux::type_is<T&> 893 { /* DUMMY BODY */ }; 871 894 872 895 // TODO: Special case when T is not referencable! … … 909 932 910 933 template<class T> 911 struct remove_extent; 934 struct remove_extent: aux::type_is<T> 935 { /* DUMMY BODY */ }; 936 937 template<class T> 938 struct remove_extent<T[]>: aux::type_is<T> 939 { /* DUMMY BODY */ }; 940 941 template<class T, size_t N> 942 struct remove_extent<T[N]>: aux::type_is<T> 943 { /* DUMMY BODY */ }; 912 944 913 945 template<class T> … … 925 957 926 958 template<class T> 927 struct remove_pointer; 959 struct remove_pointer: aux::type_is<T> 960 { /* DUMMY BODY */ }; 961 962 template<class T> 963 struct remove_pointer<T*>: aux::type_is<T> 964 { /* DUMMY BODY */ }; 965 966 template<class T> 967 struct remove_pointer<T* const>: aux::type_is<T> 968 { /* DUMMY BODY */ }; 969 970 template<class T> 971 struct remove_pointer<T* volatile>: aux::type_is<T> 972 { /* DUMMY BODY */ }; 973 974 template<class T> 975 struct remove_pointer<T* const volatile>: aux::type_is<T> 976 { /* DUMMY BODY */ }; 928 977 929 978 template<class T> … … 939 988 * 20.10.7.6, other transformations: 940 989 */ 941 942 template<class...>943 using void_t = void;944 990 945 991 // TODO: consult standard on the default value of align
Note:
See TracChangeset
for help on using the changeset viewer.