C++ boost 几何错误 : no matching function for call to 'assertion_failed'

标签 c++ boost boost-geometry

我正在尝试使用 Boost 库测试一个多边形是否包含在另一个多边形中。我刚开始使用 this 编写代码例如,甚至在我开始我的主 block 之前就遇到了一个巨大的编译错误。 (它太大了,所以抛出了一个错误,说明问题正文长度超过了 30000 个字符的限制)。我的代码是

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

int main(int argc, char** argv)
{
   typedef boost::geometry::model::polygon<boost::tuple<int, int> > polygon;
   polygon poly;
   return 0;
}

但是,这会产生如下所示的大量编译错误。这是部分输出,完整输出在 http://dpaste.com/2W2HZFD

Pranavs-MacBook-Pro: pranav$ g++ bp.cpp
In file included from bp.cpp:1:
In file included from /usr/local/include/boost/geometry.hpp:17:
In file included from /usr/local/include/boost/geometry/geometry.hpp:26:
In file included from /usr/local/include/boost/geometry/core/coordinate_dimension.hpp:24:
/usr/local/include/boost/geometry/core/point_type.hpp:45:5: error: no matching function for call to 'assertion_failed'
    BOOST_MPL_ASSERT_MSG
    ^~~~~~~~~~~~~~~~~~~~
/usr/local/include/boost/mpl/assert.hpp:435:48: note: expanded from macro 'BOOST_MPL_ASSERT_MSG'
#define BOOST_MPL_ASSERT_MSG( c, msg, types_ ) \
                                               ^
/usr/local/include/boost/mpl/assert.hpp:429:9: note: expanded from macro '\
BOOST_MPL_ASSERT_MSG_IMPL'
        boost::mpl::assertion_failed<(c)>( BOOST_PP_CAT(mpl_assert_arg,counter)::assert_arg() ) \
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/boost/mpl/assert.hpp:60:58: note: expanded from macro '\
BOOST_MPL_AUX_ASSERT_CONSTANT'
#   define BOOST_MPL_AUX_ASSERT_CONSTANT(T, expr) enum { expr }
                                                         ^
/usr/local/include/boost/geometry/core/point_type.hpp:65:30: note: in instantiation of template class
      'boost::geometry::traits::point_type<boost::tuples::tuple<int, int, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> >' requested here
            typename traits::point_type<Geometry>::type
                             ^
/usr/local/include/boost/geometry/core/coordinate_type.hpp:58:22: note: in instantiation of template class
      'boost::geometry::core_dispatch::point_type<void, boost::tuples::tuple<int, int, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type> >' requested here
    typedef typename point_type<GeometryTag, Geometry>::type point_type;
                     ^
/usr/local/include/boost/geometry/core/coordinate_type.hpp:88:37: note: in instantiation of template class
      'boost::geometry::core_dispatch::coordinate_type<void, boost::tuples::tuple<int, int, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type> >' requested here
    typedef typename core_dispatch::coordinate_type
                                    ^
/usr/local/include/boost/geometry/geometries/concepts/point_concept.hpp:98:22: note: in instantiation of template class
      'boost::geometry::coordinate_type<boost::tuples::tuple<int, int, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> >' requested here
    typedef typename coordinate_type<Geometry>::type ctype;
                     ^
/usr/local/include/boost/concept/detail/has_constraints.hpp:32:63: note: in instantiation of template class
      'boost::geometry::concept::Point<boost::tuples::tuple<int, int, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> >' requested here
  inline yes has_constraints_(Model*, wrap_constraints<Model,&Model::constraints>* = 0);
                                                              ^
/usr/local/include/boost/concept/detail/has_constraints.hpp:44:25: note: while substituting deduced template arguments into function template
      'has_constraints_' [with Model = boost::geometry::concept::Point<boost::tuples::tuple<int, int, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type> >]
      , value = sizeof( detail::has_constraints_((Model*)0) ) == sizeof(detail::yes) );
                        ^
/usr/local/include/boost/config/suffix.hpp:394:72: note: expanded from macro 'BOOST_STATIC_CONSTANT'
#     define BOOST_STATIC_CONSTANT(type, assignment) static const type assignment
                                                                       ^
/usr/local/include/boost/mpl/if.hpp:63:68: note: in instantiation of template class
      'boost::concepts::not_satisfied<boost::geometry::concept::Point<boost::tuples::tuple<int, int, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type> > >' requested here
          BOOST_MPL_AUX_STATIC_CAST(bool, BOOST_MPL_AUX_VALUE_WKND(T1)::value)
                                                                   ^
/usr/local/include/boost/mpl/aux_/value_wknd.hpp:57:40: note: expanded from macro 'BOOST_MPL_AUX_VALUE_WKND'
#   define BOOST_MPL_AUX_VALUE_WKND(C) C
                                       ^
/usr/local/include/boost/mpl/aux_/static_cast.hpp:24:62: note: expanded from macro 'BOOST_MPL_AUX_STATIC_CAST'
#   define BOOST_MPL_AUX_STATIC_CAST(T, expr) static_cast<T>(expr)
                                                             ^
/usr/local/include/boost/concept/detail/general.hpp:51:10: note: in instantiation of template class
      'boost::mpl::if_<boost::concepts::not_satisfied<boost::geometry::concept::Point<boost::tuples::tuple<int, int, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type> > >, boost::concepts::constraint<boost::geometry::concept::Point<boost::tuples::tuple<int, int,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> > >, boost::concepts::requirement<boost::concepts::failed
      ************boost::geometry::concept::Point<boost::tuples::tuple<int, int, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type> >::************> >' requested here
  : mpl::if_<
         ^
/usr/local/include/boost/geometry/geometries/polygon.hpp:79:5: note: in instantiation of template class 'boost::concepts::requirement_<void
      (*)(boost::geometry::concept::Point<boost::tuples::tuple<int, int, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> >)>' requested
      here
    BOOST_CONCEPT_ASSERT( (concept::Point<Point>) );
    ^
/usr/local/include/boost/concept/assert.hpp:43:5: note: expanded from macro 'BOOST_CONCEPT_ASSERT'
    BOOST_CONCEPT_ASSERT_FN(void(*)ModelInParens)
    ^
/usr/local/include/boost/concept/detail/general.hpp:78:25: note: expanded from macro 'BOOST_CONCEPT_ASSERT_FN'
    &::boost::concepts::requirement_<ModelFnPtr>::failed>    \
                        ^
bp.cpp:8:12: note: in instantiation of template class 'boost::geometry::model::polygon<boost::tuples::tuple<int, int, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type>, true, true, std::vector, std::vector, std::allocator, std::allocator>' requested here
   polygon poly;
           ^
/usr/local/include/boost/mpl/assert.hpp:83:5: note: candidate function [with C = false] not viable: no known conversion from 'boost::mpl::failed
      ************(boost::geometry::traits::point_type<boost::tuples::tuple<int, int, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type> >::NOT_IMPLEMENTED_FOR_THIS_POINT_TYPE::************)(types<boost::tuples::tuple<int, int, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type> >)' to 'typename assert<false>::type' (aka 'mpl_::assert<false>') for 1st argument
int assertion_failed( typename assert<C>::type );
    ^
In file included from bp.cpp:1:
In file included from /usr/local/include/boost/geometry.hpp:17:
In file included from /usr/local/include/boost/geometry/geometry.hpp:28:
/usr/local/include/boost/geometry/core/coordinate_type.hpp:43:5: error: no matching function for call to 'assertion_failed'
    BOOST_MPL_ASSERT_MSG
    ^~~~~~~~~~~~~~~~~~~~
/usr/local/include/boost/mpl/assert.hpp:435:48: note: expanded from macro 'BOOST_MPL_ASSERT_MSG'
#define BOOST_MPL_ASSERT_MSG( c, msg, types_ ) \
                                               ^
/usr/local/include/boost/mpl/assert.hpp:429:9: note: expanded from macro '\
BOOST_MPL_ASSERT_MSG_IMPL'
        boost::mpl::assertion_failed<(c)>( BOOST_PP_CAT(mpl_assert_arg,counter)::assert_arg() ) \
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/boost/mpl/assert.hpp:60:58: note: expanded from macro '\
BOOST_MPL_AUX_ASSERT_CONSTANT'
#   define BOOST_MPL_AUX_ASSERT_CONSTANT(T, expr) enum { expr }
                                                         ^
/usr/local/include/boost/geometry/core/coordinate_type.hpp:67:30: note: in instantiation of template class 'boost::geometry::traits::coordinate_type<int,
      void>' requested here
    typedef typename traits::coordinate_type
                             ^
/usr/local/include/boost/geometry/core/coordinate_type.hpp:61:22: note: in instantiation of template class
      'boost::geometry::core_dispatch::coordinate_type<boost::geometry::point_tag, int>' requested here
    typedef typename coordinate_type<point_tag, point_type>::type type;
                     ^
/usr/local/include/boost/geometry/core/coordinate_type.hpp:88:37: note: in instantiation of template class
      'boost::geometry::core_dispatch::coordinate_type<void, boost::tuples::tuple<int, int, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type> >' requested here
    typedef typename core_dispatch::coordinate_type
                                    ^
/usr/local/include/boost/geometry/geometries/concepts/point_concept.hpp:98:22: note: in instantiation of template class
      'boost::geometry::coordinate_type<boost::tuples::tuple<int, int, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> >' requested here
    typedef typename coordinate_type<Geometry>::type ctype;
                     ^
/usr/local/include/boost/concept/detail/has_constraints.hpp:32:63: note: in instantiation of template class
      'boost::geometry::concept::Point<boost::tuples::tuple<int, int, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> >' requested here
  inline yes has_constraints_(Model*, wrap_constraints<Model,&Model::constraints>* = 0);
                                                              ^
/usr/local/include/boost/concept/detail/has_constraints.hpp:44:25: note: while substituting deduced template arguments into function template
      'has_constraints_' [with Model = boost::geometry::concept::Point<boost::tuples::tuple<int, int, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type> >]
      , value = sizeof( detail::has_constraints_((Model*)0) ) == sizeof(detail::yes) );
                        ^
/usr/local/include/boost/config/suffix.hpp:394:72: note: expanded from macro 'BOOST_STATIC_CONSTANT'
#     define BOOST_STATIC_CONSTANT(type, assignment) static const type assignment
                                                                       ^
/usr/local/include/boost/mpl/if.hpp:63:68: note: in instantiation of template class
      'boost::concepts::not_satisfied<boost::geometry::concept::Point<boost::tuples::tuple<int, int, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type> > >' requested here
          BOOST_MPL_AUX_STATIC_CAST(bool, BOOST_MPL_AUX_VALUE_WKND(T1)::value)
                                                                   ^
/usr/local/include/boost/mpl/aux_/value_wknd.hpp:57:40: note: expanded from macro 'BOOST_MPL_AUX_VALUE_WKND'
#   define BOOST_MPL_AUX_VALUE_WKND(C) C
                                       ^
/usr/local/include/boost/mpl/aux_/static_cast.hpp:24:62: note: expanded from macro 'BOOST_MPL_AUX_STATIC_CAST'
#   define BOOST_MPL_AUX_STATIC_CAST(T, expr) static_cast<T>(expr)
                                                             ^
/usr/local/include/boost/concept/detail/general.hpp:51:10: note: in instantiation of template class
      'boost::mpl::if_<boost::concepts::not_satisfied<boost::geometry::concept::Point<boost::tuples::tuple<int, int, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type> > >, boost::concepts::constraint<boost::geometry::concept::Point<boost::tuples::tuple<int, int,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> > >, boost::concepts::requirement<boost::concepts::failed
      ************boost::geometry::concept::Point<boost::tuples::tuple<int, int, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type> >::************> >' requested here
  : mpl::if_<
         ^
/usr/local/include/boost/geometry/geometries/polygon.hpp:79:5: note: in instantiation of template class 'boost::concepts::requirement_<void
      (*)(boost::geometry::concept::Point<boost::tuples::tuple<int, int, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> >)>' requested
      here
    BOOST_CONCEPT_ASSERT( (concept::Point<Point>) );
    ^
/usr/local/include/boost/concept/assert.hpp:43:5: note: expanded from macro 'BOOST_CONCEPT_ASSERT'
    BOOST_CONCEPT_ASSERT_FN(void(*)ModelInParens)
    ^
/usr/local/include/boost/concept/detail/general.hpp:78:25: note: expanded from macro 'BOOST_CONCEPT_ASSERT_FN'
    &::boost::concepts::requirement_<ModelFnPtr>::failed>    \
                        ^
bp.cpp:8:12: note: in instantiation of template class 'boost::geometry::model::polygon<boost::tuples::tuple<int, int, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type>, true, true, std::vector, std::vector, std::allocator, std::allocator>' requested here
   polygon poly;
           ^
/usr/local/include/boost/mpl/assert.hpp:83:5: note: candidate function [with C = false] not viable: no known conversion from 'boost::mpl::failed
      ************(boost::geometry::traits::coordinate_type<int, void>::NOT_IMPLEMENTED_FOR_THIS_POINT_TYPE::************)(types<int>)' to
      'typename assert<false>::type' (aka 'mpl_::assert<false>') for 1st argument
int assertion_failed( typename assert<C>::type );
    ^
In file included from bp.cpp:1:
In file included from /usr/local/include/boost/geometry.hpp:17:
In file included from /usr/local/include/boost/geometry/geometry.hpp:27:
/usr/local/include/boost/geometry/core/coordinate_system.hpp:42:5: error: no matching function for call to 'assertion_failed'
    BOOST_MPL_ASSERT_MSG
    ^~~~~~~~~~~~~~~~~~~~
/usr/local/include/boost/mpl/assert.hpp:435:48: note: expanded from macro 'BOOST_MPL_ASSERT_MSG'
#define BOOST_MPL_ASSERT_MSG( c, msg, types_ ) \
                                               ^
/usr/local/include/boost/mpl/assert.hpp:429:9: note: expanded from macro '\
BOOST_MPL_ASSERT_MSG_IMPL'
        boost::mpl::assertion_failed<(c)>( BOOST_PP_CAT(mpl_assert_arg,counter)::assert_arg() ) \
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/boost/mpl/assert.hpp:60:58: note: expanded from macro '\
BOOST_MPL_AUX_ASSERT_CONSTANT'
#   define BOOST_MPL_AUX_ASSERT_CONSTANT(T, expr) enum { expr }
                                                         ^
/usr/local/include/boost/geometry/core/coordinate_system.hpp:68:34: note: in instantiation of template class
      'boost::geometry::traits::coordinate_system<int, void>' requested here
        typedef typename traits::coordinate_system
                                 ^
/usr/local/include/boost/geometry/core/coordinate_system.hpp:61:26: note: in instantiation of template class
      'boost::geometry::core_dispatch::coordinate_system<boost::geometry::point_tag, int>' requested here
        typedef typename coordinate_system<point_tag, P>::type type;
                         ^
/usr/local/include/boost/geometry/core/coordinate_system.hpp:89:37: note: in instantiation of template class
      'boost::geometry::core_dispatch::coordinate_system<void, boost::tuples::tuple<int, int, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type> >' requested here
    typedef typename core_dispatch::coordinate_system
                                    ^
/usr/local/include/boost/geometry/geometries/concepts/point_concept.hpp:99:22: note: in instantiation of template class
      'boost::geometry::coordinate_system<boost::tuples::tuple<int, int, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> >' requested here
    typedef typename coordinate_system<Geometry>::type csystem;
                     ^
/usr/local/include/boost/concept/detail/has_constraints.hpp:32:63: note: in instantiation of template class
      'boost::geometry::concept::Point<boost::tuples::tuple<int, int, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> >' requested here
  inline yes has_constraints_(Model*, wrap_constraints<Model,&Model::constraints>* = 0);
                                                              ^
/usr/local/include/boost/concept/detail/has_constraints.hpp:44:25: note: while substituting deduced template arguments into function template
      'has_constraints_' [with Model = boost::geometry::concept::Point<boost::tuples::tuple<int, int, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type> >]
      , value = sizeof( detail::has_constraints_((Model*)0) ) == sizeof(detail::yes) );
                        ^
/usr/local/include/boost/config/suffix.hpp:394:72: note: expanded from macro 'BOOST_STATIC_CONSTANT'
#     define BOOST_STATIC_CONSTANT(type, assignment) static const type assignment
                                                                       ^
/usr/local/include/boost/mpl/if.hpp:63:68: note: in instantiation of template class
      'boost::concepts::not_satisfied<boost::geometry::concept::Point<boost::tuples::tuple<int, int, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type> > >' requested here
          BOOST_MPL_AUX_STATIC_CAST(bool, BOOST_MPL_AUX_VALUE_WKND(T1)::value)
                                                                   ^
/usr/local/include/boost/mpl/aux_/value_wknd.hpp:57:40: note: expanded from macro 'BOOST_MPL_AUX_VALUE_WKND'
#   define BOOST_MPL_AUX_VALUE_WKND(C) C
                                       ^
/usr/local/include/boost/mpl/aux_/static_cast.hpp:24:62: note: expanded from macro 'BOOST_MPL_AUX_STATIC_CAST'
#   define BOOST_MPL_AUX_STATIC_CAST(T, expr) static_cast<T>(expr)
                                                             ^
/usr/local/include/boost/concept/detail/general.hpp:51:10: note: in instantiation of template class
      'boost::mpl::if_<boost::concepts::not_satisfied<boost::geometry::concept::Point<boost::tuples::tuple<int, int, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type> > >, boost::concepts::constraint<boost::geometry::concept::Point<boost::tuples::tuple<int, int,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> > >, boost::concepts::requirement<boost::concepts::failed
      ************boost::geometry::concept::Point<boost::tuples::tuple<int, int, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type> >::************> >' requested here
  : mpl::if_<
         ^
/usr/local/include/boost/geometry/geometries/polygon.hpp:79:5: note: in instantiation of template class 'boost::concepts::requirement_<void
      (*)(boost::geometry::concept::Point<boost::tuples::tuple<int, int, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> >)>' requested
      here
    BOOST_CONCEPT_ASSERT( (concept::Point<Point>) );
    ^
/usr/local/include/boost/concept/assert.hpp:43:5: note: expanded from macro 'BOOST_CONCEPT_ASSERT'
    BOOST_CONCEPT_ASSERT_FN(void(*)ModelInParens)
    ^
/usr/local/include/boost/concept/detail/general.hpp:78:25: note: expanded from macro 'BOOST_CONCEPT_ASSERT_FN'
    &::boost::concepts::requirement_<ModelFnPtr>::failed>    \
                        ^
bp.cpp:8:12: note: in instantiation of template class 'boost::geometry::model::polygon<boost::tuples::tuple<int, int, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,
      boost::tuples::null_type, boost::tuples::null_type>, true, true, std::vector, std::vector, std::allocator, std::allocator>' requested here
   polygon poly;
           ^
/usr/local/include/boost/mpl/assert.hpp:83:5: note: candidate function [with C = false] not viable: no known conversion from 'boost::mpl::failed
      ************(boost::geometry::traits::coordinate_system<int, void>::NOT_IMPLEMENTED_FOR_THIS_POINT_TYPE::************)(types<int>)' to
      'typename assert<false>::type' (aka 'mpl_::assert<false>') for 1st argument
int assertion_failed( typename assert<C>::type );
    ^
                    ^

有什么问题吗?

最佳答案

您的示例不完整:registration of tuples是必需的(以指示您正在使用的坐标系)。

#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/polygon.hpp>
#include <boost/geometry/geometries/adapted/boost_tuple.hpp> 

BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) 

int main(int argc, char** argv)
{
   typedef boost::geometry::model::polygon<boost::tuple<int, int> > polygon;
   polygon poly;
   return 0;
}

compiles有几个关于未使用变量的警告,但没有错误。

关于C++ boost 几何错误 : no matching function for call to 'assertion_failed' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32639081/

相关文章:

c++ - boost::log 在容器中保存消息,然后将所有消息发送到后端

c++ - 编译时增加几何距离()错误

c++ - 将点从 cs::cartesian 转换为 WGS84

c++ - 如何有条件地实例化一个对象?

c++ - 使用 GPGME 生成 key 时出错

C++:使用 Boost 序列化来写入/读取文件

c++ - 如何组合两个 Boost Geometry 变压器?

c++ - initializer_list 在 VC10 中不起作用

c++ - 无法包含 Clion 库中的文件

c++ - 强制 CMake 查找 x64 位库而不是 x32