Specialized enable_borrowed_ranges for VectorwiseOp class range iteration

libeigen/eigen!2127

Closes #2882
This commit is contained in:
Blake
2026-02-15 10:31:33 -05:00
committed by Rasmus Munk Larsen
parent 1a2b80727c
commit d0654a201b
4 changed files with 55 additions and 6 deletions

View File

@@ -732,4 +732,14 @@ EIGEN_DEVICE_FUNC inline typename DenseBase<Derived>::RowwiseReturnType DenseBas
} // end namespace Eigen
/* Enable use of VectorwiseOp types inside
* of std::ranges algorithms. */
#if defined(__cpp_lib_ranges) && __cpp_lib_ranges >= 201911L
namespace std {
template <typename VecwiseOp, Eigen::DirectionType Direction>
inline constexpr bool ranges::enable_borrowed_range<Eigen::internal::subvector_stl_iterator<VecwiseOp, Direction>> =
true;
}
#endif
#endif // EIGEN_PARTIAL_REDUX_H