From: Wolfgang Bangerth Date: Thu, 23 May 2024 19:54:18 +0000 (-0600) Subject: Work around a BOOST issue with C++20. X-Git-Tag: v9.6.0-rc1~229^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=748c08b83c2724e57a963e9d463621e2414a5bbc;p=dealii.git Work around a BOOST issue with C++20. --- 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>(