[libcxx-commits] [PATCH] D125283: reverts "[libc++] Explicitly reject `uniform_int_distribution<bool>` and `<char>`."

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon May 23 09:35:42 PDT 2022


ldionne added a subscriber: CaseyCarter.
ldionne added a comment.

In D125283#3528195 <https://reviews.llvm.org/D125283#3528195>, @EricWF wrote:

> GCC ships this as an extension. I can't find a reason why the extension would be non-conforming or dangerous, and it seems like a safer way for users to generate `char` values, rather than expecting the user to correctly pass the `numerical_limits<char>::max()` to the constructor.
> I think we should reach out to someone at Microsoft (maybe STL), and see how open they are to shipping this as an extension. If they're willing then we avoid the portability trap that we're trying to protect users from.

@CaseyCarter Would you be willing to, as an extension, support `char` in the random distributions? This is currently marked as being undefined by http://eel.is/c++draft/rand.req.genl#1. If you are willing, then I could also write a short paper to suggest adding it to the spec, since all three major implementations would support it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125283



More information about the libcxx-commits mailing list