(Сплит из предыдущего вопроса).
Кто-нибудь знает, что здесь происходит?Следующий код прекрасно работает в 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"