brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 75ffc27 Raw
45 lines · c
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef _LIBCPP___RANDOM_UNIFORM_RANDOM_BIT_GENERATOR_H10#define _LIBCPP___RANDOM_UNIFORM_RANDOM_BIT_GENERATOR_H11 12#include <__concepts/arithmetic.h>13#include <__concepts/invocable.h>14#include <__concepts/same_as.h>15#include <__config>16#include <__type_traits/integral_constant.h>17#include <__type_traits/invoke.h>18 19#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)20#  pragma GCC system_header21#endif22 23_LIBCPP_PUSH_MACROS24#include <__undef_macros>25 26_LIBCPP_BEGIN_NAMESPACE_STD27 28#if _LIBCPP_STD_VER >= 2029 30// [rand.req.urng]31template <class _Gen>32concept uniform_random_bit_generator = invocable<_Gen&> && unsigned_integral<invoke_result_t<_Gen&>> && requires {33  { _Gen::min() } -> same_as<invoke_result_t<_Gen&>>;34  { _Gen::max() } -> same_as<invoke_result_t<_Gen&>>;35  requires bool_constant<(_Gen::min() < _Gen::max())>::value;36};37 38#endif // _LIBCPP_STD_VER >= 2039 40_LIBCPP_END_NAMESPACE_STD41 42_LIBCPP_POP_MACROS43 44#endif // _LIBCPP___RANDOM_UNIFORM_RANDOM_BIT_GENERATOR_H45