Skip to content

Commit 2526110

Browse files
committed
fix missing &
1 parent 2f00429 commit 2526110

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

libcxx/include/__algorithm/generate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2222

2323
template <class _ForwardIterator, class _Sent, class _Generator>
2424
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
25-
__generate(_ForwardIterator __first, _Sent __last, _Generator __gen) {
25+
__generate(_ForwardIterator __first, _Sent __last, _Generator& __gen) {
2626
for (; __first != __last; ++__first)
2727
*__first = __gen();
2828
}

libcxx/test/libcxx/algorithms/robust_against_copying_comparators.pass.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,7 @@ TEST_CONSTEXPR_CXX20 bool all_the_algorithms() {
149149
assert(copies == 0);
150150
#endif
151151
(void)std::generate(first, last, NullaryValue<T>(&copies));
152-
assert(copies == 1);
153-
copies = 0;
152+
assert(copies == 0);
154153
(void)std::generate_n(first, count, NullaryValue<T>(&copies));
155154
assert(copies == 0);
156155
(void)std::includes(first, last, first2, last2, Less<T>(&copies));

0 commit comments

Comments
 (0)