Skip to content

Commit 6c1472b

Browse files
burblebeetkoeppe
authored andcommitted
LWG4085 ranges::generate_random's helper lambda should specify the return type
1 parent 14219f6 commit 6c1472b

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

source/algorithms.tex

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11934,7 +11934,8 @@
1193411934
\begin{itemdecl}
1193511935
template<class R, class G, class D>
1193611936
requires @\libconcept{output_range}@<R, invoke_result_t<D&, G&>> && @\libconcept{invocable}@<D&, G&> &&
11937-
@\libconcept{uniform_random_bit_generator}@<remove_cvref_t<G>>
11937+
@\libconcept{uniform_random_bit_generator}@<remove_cvref_t<G>> &&
11938+
is_arithmetic_v<invoke_result_t<D&, G&>>
1193811939
constexpr borrowed_iterator_t<R> ranges::generate_random(R&& r, G&& g, D&& d);
1193911940
\end{itemdecl}
1194011941

@@ -11983,7 +11984,8 @@
1198311984

1198411985
\begin{itemdecl}
1198511986
template<class G, class D, @\libconcept{output_iterator}@<invoke_result_t<D&, G&>> O, @\libconcept{sentinel_for}@<O> S>
11986-
requires @\libconcept{invocable}@<D&, G&> && @\libconcept{uniform_random_bit_generator}@<remove_cvref_t<G>>
11987+
requires @\libconcept{invocable}@<D&, G&> && @\libconcept{uniform_random_bit_generator}@<remove_cvref_t<G>> &&
11988+
is_arithmetic_v<invoke_result_t<D&, G&>>
1198711989
constexpr O ranges::generate_random(O first, S last, G&& g, D&& d);
1198811990
\end{itemdecl}
1198911991

source/numerics.tex

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,11 +1451,13 @@
14511451

14521452
template<class R, class G, class D>
14531453
requires @\libconcept{output_range}@<R, invoke_result_t<D&, G&>> && @\libconcept{invocable}@<D&, G&> &&
1454-
@\libconcept{uniform_random_bit_generator}@<remove_cvref_t<G>>
1454+
@\libconcept{uniform_random_bit_generator}@<remove_cvref_t<G>> &&
1455+
is_arithmetic_v<invoke_result_t<D&, G&>>
14551456
constexpr borrowed_iterator_t<R> generate_random(R&& r, G&& g, D&& d);
14561457

14571458
template<class G, class D, @\libconcept{output_iterator}@<invoke_result_t<D&, G&>> O, @\libconcept{sentinel_for}@<O> S>
1458-
requires @\libconcept{invocable}@<D&, G&> && @\libconcept{uniform_random_bit_generator}@<remove_cvref_t<G>>
1459+
requires @\libconcept{invocable}@<D&, G&> && @\libconcept{uniform_random_bit_generator}@<remove_cvref_t<G>> &&
1460+
is_arithmetic_v<invoke_result_t<D&, G&>>
14591461
constexpr O generate_random(O first, S last, G&& g, D&& d);
14601462
}
14611463

0 commit comments

Comments
 (0)