make code compliant with std=c++20 (#2123)

This commit is contained in:
Illia Silin
2025-04-24 10:14:52 -07:00
committed by GitHub
parent ba97363acd
commit 01cb8379cd
3 changed files with 6 additions and 6 deletions

View File

@@ -94,7 +94,7 @@ struct FillMonotonicSeq
template <typename ForwardIter>
void operator()(ForwardIter first, ForwardIter last) const
{
std::generate(first, last, [=, n = init_value_]() mutable {
std::generate(first, last, [=, *this, n = init_value_]() mutable {
auto tmp = n;
n += step_;
return tmp;
@@ -150,7 +150,7 @@ struct TransformIntoStructuralSparsity
template <typename ForwardIter>
void operator()(ForwardIter first, ForwardIter last) const
{
std::for_each(first, last, [=, idx = 0](T& elem) mutable {
std::for_each(first, last, [=, *this, idx = 0](T& elem) mutable {
auto tmp_idx = idx;
idx += 1;
return elem *= valid_sequences[tmp_idx % (sizeof(valid_sequences) / sizeof(T))];

View File

@@ -252,7 +252,7 @@ struct ParallelTensorFunctor
std::size_t iw_begin = it * work_per_thread;
std::size_t iw_end = std::min((it + 1) * work_per_thread, mN1d);
auto f = [=] {
auto f = [=, *this] {
for(std::size_t iw = iw_begin; iw < iw_end; ++iw)
{
call_f_unpack_args(mF, GetNdIndices(iw));