File indexing completed on 2026-05-03 08:13:59
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef _LIBCPP___RANDOM_IS_VALID_H
0010 #define _LIBCPP___RANDOM_IS_VALID_H
0011
0012 #include <__config>
0013 #include <__type_traits/enable_if.h>
0014 #include <__type_traits/integral_constant.h>
0015 #include <__type_traits/is_same.h>
0016 #include <__type_traits/is_unsigned.h>
0017 #include <__utility/declval.h>
0018 #include <cstdint>
0019
0020 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0021 # pragma GCC system_header
0022 #endif
0023
0024 _LIBCPP_BEGIN_NAMESPACE_STD
0025
0026
0027
0028
0029
0030
0031 template <class>
0032 struct __libcpp_random_is_valid_realtype : false_type {};
0033 template <>
0034 struct __libcpp_random_is_valid_realtype<float> : true_type {};
0035 template <>
0036 struct __libcpp_random_is_valid_realtype<double> : true_type {};
0037 template <>
0038 struct __libcpp_random_is_valid_realtype<long double> : true_type {};
0039
0040
0041
0042
0043
0044
0045
0046 template <class>
0047 struct __libcpp_random_is_valid_inttype : false_type {};
0048 template <>
0049 struct __libcpp_random_is_valid_inttype<int8_t> : true_type {};
0050 template <>
0051 struct __libcpp_random_is_valid_inttype<short> : true_type {};
0052 template <>
0053 struct __libcpp_random_is_valid_inttype<int> : true_type {};
0054 template <>
0055 struct __libcpp_random_is_valid_inttype<long> : true_type {};
0056 template <>
0057 struct __libcpp_random_is_valid_inttype<long long> : true_type {};
0058 template <>
0059 struct __libcpp_random_is_valid_inttype<uint8_t> : true_type {};
0060 template <>
0061 struct __libcpp_random_is_valid_inttype<unsigned short> : true_type {};
0062 template <>
0063 struct __libcpp_random_is_valid_inttype<unsigned int> : true_type {};
0064 template <>
0065 struct __libcpp_random_is_valid_inttype<unsigned long> : true_type {};
0066 template <>
0067 struct __libcpp_random_is_valid_inttype<unsigned long long> : true_type {};
0068
0069 #if _LIBCPP_HAS_INT128
0070 template <>
0071 struct __libcpp_random_is_valid_inttype<__int128_t> : true_type {};
0072 template <>
0073 struct __libcpp_random_is_valid_inttype<__uint128_t> : true_type {};
0074 #endif
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084 template <class, class = void>
0085 struct __libcpp_random_is_valid_urng : false_type {};
0086 template <class _Gp>
0087 struct __libcpp_random_is_valid_urng<
0088 _Gp,
0089 __enable_if_t< is_unsigned<typename _Gp::result_type>::value &&
0090 _IsSame<decltype(std::declval<_Gp&>()()), typename _Gp::result_type>::value > > : true_type {};
0091
0092 _LIBCPP_END_NAMESPACE_STD
0093
0094 #endif