C ++ Boost Geometry错误:没有匹配的函数来调用"assertion_failed" [英] C++ Boost Geometry error: no matching function for call to 'assertion_failed'

查看:114
本文介绍了C ++ Boost Geometry错误:没有匹配的函数来调用"assertion_failed"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Boost库测试另一个多边形中是否包含一个多边形.我刚刚开始使用 为例,即使在开始主程序段之前就出现了巨大的编译错误. (它是如此之大,所以抛出了一个错误,指出问题的正文长度超过了30000个字符的限制).我的代码为

I am trying to test if a Polygon is contained within another Polygon using Boost library. I just started writing my code using this as an example, and got a massive compile error even before I could begin my main block. (It was so massive SO threw an error stating question body length exceeded limit of 30000 chars). My code goes as

#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

However, this generates massive compile error which goes as below. This is partial output, complete output is at 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 );
    ^
                    ^

有什么问题吗?

推荐答案

您的示例不完整:

Your example is not complete: registration of tuples is necessary (to indicate which coordinate system you are using).

#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;
}

编译 ,其中有关于未使用变量的警告,但没有错误.

This compiles with a couple of warnings about unused variables, but without errors.

这篇关于C ++ Boost Geometry错误:没有匹配的函数来调用"assertion_failed"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆