From 748c08b83c2724e57a963e9d463621e2414a5bbc Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 23 May 2024 13:54:18 -0600 Subject: [PATCH] Work around a BOOST issue with C++20. --- include/deal.II/numerics/rtree.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/include/deal.II/numerics/rtree.h b/include/deal.II/numerics/rtree.h index d132a6d9f5..2ee8a697f6 100644 --- a/include/deal.II/numerics/rtree.h +++ b/include/deal.II/numerics/rtree.h @@ -498,9 +498,17 @@ RTree> pack_rtree_of_indices(const ContainerType &container) { - std_cxx20::ranges::iota_view - indices(0, container.size()); + // We need an array that holds the indices we want to pack. The rtree + // implementation in BOOST, for reasons not entirely clear, insists + // on using a reference to the elements of the range. This is fine if + // the indices are stored in a container, so that's what we do. + // (It would be nice if we could just pass a std::ranges::iota_view + // instead, but that has no nested 'reference' type, and this then + // trips up BOOST rtree.) + std::vector indices(container.size()); + for (typename ContainerType::size_type i = 0; i < container.size(); ++i) + indices[i] = i; + return RTree>( -- 2.39.5