0

我正在尝试使用boost::polygonwithboost::multiprecision来计算多边形差异,但无论我如何尝试将两者结合起来,我总是会遇到编译器错误,例如

assigning to 'long double' from incompatible type 'boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<0, 0, boost::multiprecision::signed_magnitude, boost::multiprecision::unchecked, std::allocator<unsigned long long>>, boost::multiprecision::et_off>'

https://github.com/boostorg/polygon/blob/develop/include/boost/polygon/detail/polygon_arbitrary_formation.hpp#L401

以及尝试回读结果时的类似位置:

using DifferenceResults = std::vector<gtl::polygon_with_holes_data<ValueType>>;
DifferenceResults differenceResult;
result.value().get<DifferenceResults>(differenceResult);

这是我尝试过的

我这样做对吗?我尝试了不同的东西,coordinate_traits但最后看起来像evalAtXforYlazy这样的惰性函数中使用的类型和表达式拒绝支持这一点。

它编译得很好,没有 multiprecision

我还尝试polygon_arbitryry_formation.hpp在需要的地方修改和添加显式强制转换,这起初很有希望,但最终导致我在这里重载源自这里的结果问题。

我进一步尝试boost.multiprecisionMPIR替换,但它们甚至没有显式转换运算符,而只是用于转换的成员函数,与evalAtXforYlazy和其他函数的兼容性更差。

我究竟做错了什么?

4

0 回答 0