[libcxx-commits] [PATCH] D96577: [libcxx] adds concept `std::uniform_random_bit_generator`

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Feb 13 05:05:12 PST 2021


Mordante added a comment.

In D96577#2561522 <https://reviews.llvm.org/D96577#2561522>, @cjdb wrote:

> undoes `!_LIBCPP_HAS_NO_CONCEPTS` change in an attempt to get the Mac OS build working

Yes there seems to be a bug in that code. I've put it in a block for GCC specific code. (This is not obvious due to the lack of indention of the section.)
I'm testing a fix.



================
Comment at: libcxx/include/random:22
+template<class G>
+concept uniform_random_bit_generator = see below;
 
----------------
Please add comment this has been added in C++20.


================
Comment at: libcxx/test/std/numerics/rand/rand.req/rand.req.urng/uniform_random_bit_generator.compile.pass.cpp:20
+static_assert(std::uniform_random_bit_generator<
+              std::subtract_with_carry_engine<__uint128_t, 1U, 2U, 3U> >);
+
----------------
Can you guard this with `#ifndef _LIBCPP_HAS_NO_INT128`?


================
Comment at: libcxx/test/std/numerics/rand/rand.req/rand.req.urng/uniform_random_bit_generator.compile.pass.cpp:122
+static_assert(!std::uniform_random_bit_generator<MaxLessThanMin>);
+} // namespace MinNotLessMax
+
----------------
Can you add a test where `min()` and `max()` return the same value?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96577/new/

https://reviews.llvm.org/D96577



More information about the libcxx-commits mailing list