【问题标题】:boost::geometry::area failing to compile on intel compilerboost::geometry::area 无法在英特尔编译器上编译
【发布时间】:2011-10-12 10:54:19
【问题描述】:

(从之前的问题拆分而来)。

有人知道这里发生了什么吗?以下代码在 MSVC 中运行良好,但在 intel 编译器上运行良好。

//code to calculate area of convex hull from a set of points

#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/polygon.hpp>
#include <boost/geometry/multi/geometries/multi_point.hpp>

double convex_hull_area()
{
    using boost::geometry::model::d2::point_xy;
    using boost::geometry::append;
    using boost::geometry::make;

    //this bit works if I use a polygon instead of multi_point
    boost::geometry::model::polygon<point_xy<float> > all_points_in_radius;

    append(all_points_in_radius,make<point_xy<float> >(0,0));
    append(all_points_in_radius,make<point_xy<float> >(3,0));
    append(all_points_in_radius,make<point_xy<float> >(3,3));
    append(all_points_in_radius,make<point_xy<float> >(2,1));

    boost::geometry::model::polygon<point_xy<float> > hull;
    boost::geometry::convex_hull(all_points_in_radius,hull);
    return boost::geometry::area(hull);
}

最后一行 (boost::geometry::area) 是产生问题的那一行:

1>d:\boost\boost_1_47_0\boost/typeof/encode_decode.hpp(50): error: incomplete type is not allowed
1>      struct encode_type : BOOST_TYPEOF_ENCODE_NS_QUALIFIER::encode_type_impl<V, T>
1>                           ^
1>          detected during:
1>            instantiation of class "boost::type_of::encode_type<V, T> [with V=boost::type_of::vector2<boost::mpl::size_t<65592U>, boost::mpl::size_t<65589U>>, T=boost::geometry::model::ring<boost::geometry::model::d2::point_xy<float, boost::geometry::cs::cartesian>, 1, 1, stlp_std::vector, stlp_std::allocator>]" at line 53 of "d:\boost\boost_1_47_0\boost/typeof/modifiers.hpp"
1>            instantiation of class "<unnamed>::boost_typeof::encode_type_impl<V, const T> [with V=boost::type_of::vector1<boost::mpl::size_t<65592U>>, T=boost::geometry::model::ring<boost::geometry::model::d2::point_xy<float, boost::geometry::cs::cartesian>, 1, 1, stlp_std::vector, stlp_std::allocator>]" at line 50
1>            instantiation of class "boost::type_of::encode_type<V, T> [with V=boost::type_of::vector1<boost::mpl::size_t<65592U>>, T=const boost::geometry::model::ring<boost::geometry::model::d2::point_xy<float, boost::geometry::cs::cartesian>, 1, 1, stlp_std::vector, stlp_std::allocator>]" at line 56 of "d:\boost\boost_1_47_0\boost/typeof/modifiers.hpp"
1>            instantiation of class "<unnamed>::boost_typeof::encode_type_impl<V, T *> [with V=boost::type_of::vector0<void>, T=const boost::geometry::model::ring<boost::geometry::model::d2::point_xy<float, boost::geometry::cs::cartesian>, 1, 1, stlp_std::vector, stlp_std::allocator>]" at line 50
1>            instantiation of class "boost::type_of::encode_type<V, T> [with V=boost::type_of::vector0<void>, T=const boost::geometry::model::ring<boost::geometry::model::d2::point_xy<float, boost::geometry::cs::cartesian>, 1, 1, stlp_std::vector, stlp_std::allocator> *]" at line 42 of "d:\boost\boost_1_47_0\boost/geometry/algorithms/detail/calculate_sum.hpp"
1>            instantiation of "ReturnType boost::geometry::detail::calculate_polygon_sum<ReturnType, Polygon, Strategy, Policy>::sum_interior_rings(const Rings &, const Strategy &) [with ReturnType=double, Polygon=boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<float, boost::geometry::cs::cartesian>, 1, 1, stlp_std::vector, stlp_std::vector, stlp_std::allocator, stlp_std::allocator>,
1>                      Strategy=boost::geometry::strategy::area::surveyor<boost::geometry::model::d2::point_xy<float, boost::geometry::cs::cartesian>, void>, Policy=boost::geometry::detail::area::ring_area<const boost::geometry::model::ring<boost::geometry::model::d2::point_xy<float, boost::geometry::cs::cartesian>, 1, 1, stlp_std::vector, stlp_std::allocator>, boost::geometry::iterate_forward, boost::geometry::closed,
1>                      boost::geometry::strategy::area::surveyor<boost::geometry::model::d2::point_xy<float, boost::geometry::cs::cartesian>, void>>, Rings=stlp_std::vector<boost::geometry::model::ring<boost::geometry::model::d2::point_xy<float, boost::geometry::cs::cartesian>, 1, 1, stlp_std::vector, stlp_std::allocator>, stlp_std::allocator<boost::geometry::model::ring<boost::geometry::model::d2::point_xy<float, boost::geometry::cs::cartesian>, 1, 1, stlp_std::vector, stlp_std::allocator>>>]"
1>                      at line 54 of "d:\boost\boost_1_47_0\boost/geometry/algorithms/detail/calculate_sum.hpp"
1>            instantiation of "ReturnType boost::geometry::detail::calculate_polygon_sum<ReturnType, Polygon, Strategy, Policy>::apply(const Polygon &, const Strategy &) [with ReturnType=double, Polygon=boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<float, boost::geometry::cs::cartesian>, 1, 1, stlp_std::vector, stlp_std::vector, stlp_std::allocator, stlp_std::allocator>, Strategy=boost::geometry::strategy::area::surveyor<boost::geometry::model::d2::point_xy<float,
1>                      boost::geometry::cs::cartesian>, void>, Policy=boost::geometry::detail::area::ring_area<const boost::geometry::model::ring<boost::geometry::model::d2::point_xy<float, boost::geometry::cs::cartesian>, 1, 1, stlp_std::vector, stlp_std::allocator>, boost::geometry::iterate_forward, boost::geometry::closed, boost::geometry::strategy::area::surveyor<boost::geometry::model::d2::point_xy<float, boost::geometry::cs::cartesian>, void>>]" at line 237 of
1>                      "d:\boost\boost_1_47_0\boost/geometry/algorithms/area.hpp"
1>            instantiation of "boost::geometry::default_area_result<Geometry>::type boost::geometry::area(const Geometry &) [with Geometry=boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<float, boost::geometry::cs::cartesian>, 1, 1, stlp_std::vector, stlp_std::vector, stlp_std::allocator, stlp_std::allocator>]" at line 314 of ".\calculation.cpp"

【问题讨论】:

  • 我现在已经将此作为一个 bug 报告给 boost,让我们看看他们是否知道...
  • 事实证明 Boost 并没有正式支持 Windows 上的 Intel 编译器。

标签: c++ boost icc boost-geometry


【解决方案1】:

这是作为 boost 中的错误提交的。但是Boost在windows上并没有正式支持Intel编译器,所以可能很长一段时间都没有解决。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-01-22
    • 1970-01-01
    • 1970-01-01
    • 2021-08-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多