mirror of
https://github.com/boostorg/geometry.git
synced 2025-05-11 05:24:02 +00:00
[fix] replace decltype by typename for some compilers
This commit is contained in:
parent
425263e166
commit
993b36515c
@ -721,24 +721,31 @@ struct sectionalize_multi
|
|||||||
template <typename Sections, typename Strategy>
|
template <typename Sections, typename Strategy>
|
||||||
inline void enlarge_sections(Sections& sections, Strategy const&)
|
inline void enlarge_sections(Sections& sections, Strategy const&)
|
||||||
{
|
{
|
||||||
// Expand the box to avoid missing any intersection. The amount is
|
// Expand the box to avoid missing any intersection.
|
||||||
// should be larger than epsilon. About the value itself: the smaller
|
// About the value itself: the smaller it is,
|
||||||
// it is, the higher the risk to miss intersections. The larger it is,
|
// the higher the risk to miss intersections.
|
||||||
// the more comparisons are made, which is not harmful for the result
|
// The larger it is, the more comparisons are made,
|
||||||
// (but it might be for the performance).
|
// which is not harmful for the result,
|
||||||
// So it should be on the high side.
|
// but it might be for the performance.
|
||||||
|
// So it should be on the higher side.
|
||||||
// Use a compilable and workable epsilon for all types, for example:
|
//
|
||||||
|
// The current value:
|
||||||
// - for double :~ 2.22e-13
|
// - for double :~ 2.22e-13
|
||||||
// - for float :~ 1e-4
|
// - for float :~ 1e-4
|
||||||
// - for Boost.Multiprecision (50) :~ 5.35e-48
|
// - for Boost.Multiprecision (50) :~ 5.35e-48
|
||||||
// - for Boost.Rational : 0/1
|
// - for Boost.Rational : 0/1
|
||||||
|
|
||||||
|
// WARNING: don't use decltype here.
|
||||||
|
// Earlier code used decltype(section.bonding_box) below,
|
||||||
|
// but that somehow is not accepted by the NVCC (CUDA 12.4) compiler.
|
||||||
|
using section_t = typename boost::range_value<Sections>::type;
|
||||||
|
using box_t = typename section_t::box_type;
|
||||||
|
using coor_t = typename geometry::coordinate_type<box_t>::type;
|
||||||
|
|
||||||
|
static auto const eps = math::scaled_epsilon<coor_t>(1000);
|
||||||
|
|
||||||
for (auto& section : sections)
|
for (auto& section : sections)
|
||||||
{
|
{
|
||||||
using gt = decltype(section.bounding_box);
|
|
||||||
using ct = typename geometry::coordinate_type<gt>::type;
|
|
||||||
static ct const eps = math::scaled_epsilon<ct>(1000);
|
|
||||||
expand_by_epsilon(section.bounding_box, eps);
|
expand_by_epsilon(section.bounding_box, eps);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user