]> gcc.gnu.org Git - gcc.git/blobdiff - libstdc++-v3/include/bits/uniform_int_dist.h
libstdc++: Reduce header dependencies for C++20 (PR 92546)
[gcc.git] / libstdc++-v3 / include / bits / uniform_int_dist.h
index d2a015706352f1b0227b252c0e3dbdbe3caa244e..e3d7934e9977c632de63bd9821f0bda921c2cd8c 100644 (file)
 
 #include <type_traits>
 #include <limits>
+#if __cplusplus > 201703L
+# include <concepts>
+#endif
 
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
+#ifdef __cpp_lib_concepts
+  /// Requirements for a uniform random bit generator.
+  template<typename _Gen>
+    concept uniform_random_bit_generator
+      = invocable<_Gen&> && unsigned_integral<invoke_result_t<_Gen&>>
+      && requires
+      {
+       { _Gen::min() } -> same_as<invoke_result_t<_Gen&>>;
+       { _Gen::max() } -> same_as<invoke_result_t<_Gen&>>;
+       requires bool_constant<(_Gen::min() < _Gen::max())>::value;
+      };
+#endif
+
   namespace __detail
   {
     /* Determine whether number is a power of 2.  */
This page took 0.027622 seconds and 5 git commands to generate.