[libcxx-commits] [PATCH] D114920: [libc++] Explicitly reject `uniform_int_distribution<bool>`.

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Dec 6 07:53:32 PST 2021


Quuxplusone added inline comments.


================
Comment at: libcxx/include/__random/is_valid_inttype.h:21-40
+// [rand.req.genl]/1.5:
+// The effect of instantiating a template that has a template type parameter
+// named IntType is undefined unless the corresponding template argument is
+// cv-unqualified and is one of short, int, long, long long, unsigned short,
+// unsigned int, unsigned long, or unsigned long long.
+
+template<class> struct __random_is_valid_inttype : false_type {};
----------------
I'm not thrilled about this helper or its placement/naming, but it seemed like the best option.
Incidentally, this also gives people a sneaky libc++ internal detail that they can (unsupportedly) specialize in order to re-enable the removed functionality for specific user-defined types.
Should this helper be named `__libcpp_*`?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114920



More information about the libcxx-commits mailing list