aboutsummaryrefslogtreecommitdiff
path: root/libcxx/include/algorithm
diff options
context:
space:
mode:
authorMarek Kurdej <marek.kurdej@gmail.com>2021-01-19 08:21:09 +0100
committerMarek Kurdej <marek.kurdej@gmail.com>2021-01-19 08:22:06 +0100
commita11f8b1ad66d68ca0a3a277ce776007abff9c7eb (patch)
tree0ad4cca7fe9f6a0ff1cf8278b9f3d1a526369e55 /libcxx/include/algorithm
parent9cf511aa08ae2a5b94e9cefe3fc60cc33358519b (diff)
downloadllvm-a11f8b1ad66d68ca0a3a277ce776007abff9c7eb.zip
llvm-a11f8b1ad66d68ca0a3a277ce776007abff9c7eb.tar.gz
llvm-a11f8b1ad66d68ca0a3a277ce776007abff9c7eb.tar.bz2
[libc++] [P0935] [C++20] Eradicating unnecessarily explicit default constructors from the standard library.
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html Reviewed By: ldionne, #libc Differential Revision: https://reviews.llvm.org/D91292
Diffstat (limited to 'libcxx/include/algorithm')
-rw-r--r--libcxx/include/algorithm12
1 files changed, 10 insertions, 2 deletions
diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm
index fe9caf4..da55e5e 100644
--- a/libcxx/include/algorithm
+++ b/libcxx/include/algorithm
@@ -3029,9 +3029,17 @@ private:
public:
// constructors and reset functions
- explicit uniform_int_distribution(result_type __a = 0,
- result_type __b = numeric_limits<result_type>::max())
+#ifndef _LIBCPP_CXX03_LANG
+ uniform_int_distribution() : uniform_int_distribution(0) {}
+ explicit uniform_int_distribution(
+ result_type __a, result_type __b = numeric_limits<result_type>::max())
+ : __p_(param_type(__a, __b)) {}
+#else
+ explicit uniform_int_distribution(
+ result_type __a = 0,
+ result_type __b = numeric_limits<result_type>::max())
: __p_(param_type(__a, __b)) {}
+#endif
explicit uniform_int_distribution(const param_type& __p) : __p_(__p) {}
void reset() {}