C++ 带有CGAL 4.12-beta 2的警告C4503

C++ 带有CGAL 4.12-beta 2的警告C4503,c++,visual-studio-2012,cgal,C++,Visual Studio 2012,Cgal,在我从cgal4.4移动到cgal4.12-beta2之后,我的代码开始生成警告C4503。我正在windows 7操作系统上使用Visual Studio 2012。 根据编译器,以下声明是有问题的代码 struct pairA { int A1; int A2; pairA():A1(int()),A2(int()){} }; struct pairB { int B1; IdType B2; pairB():B1(int()),B2(IdTy

在我从
cgal4.4
移动到
cgal4.12-beta2
之后,我的代码开始生成
警告C4503
。我正在windows 7操作系统上使用Visual Studio 2012。 根据编译器,以下声明是有问题的代码

struct pairA
{
    int A1;
    int A2;
    pairA():A1(int()),A2(int()){}
};
struct pairB
{
    int B1;
    IdType B2;
    pairB():B1(int()),B2(IdType()){}
};
struct pairInfo
{
    pairA pA;
    pairB pB;

};
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef CGAL::Triangulation_vertex_base_with_info_2<pairInfo, Kernel > Vertex_base; //<0 - boundary , -1 not associated, >0 associated with edge>
typedef CGAL::Delaunay_mesh_face_base_2< Kernel > Face_base;
//typedef CGAL::Triangulation_face_base_with_info_2<std::pair<int,int>, Kernel> Face_base;  //does not work with constrained triangulation?
typedef CGAL::Exact_predicates_tag    Itag;
typedef CGAL::Triangulation_data_structure_2<  Vertex_base, Face_base > Triangulation_data;
typedef CGAL::Constrained_Delaunay_triangulation_2< Kernel, Triangulation_data, Itag > CDTriangulation;
typedef CGAL::Constrained_triangulation_plus_2<CDTriangulation>    CDTriangulationPlus;
typedef CGAL::Delaunay_mesh_size_criteria_2< CDTriangulationPlus > Criteria;
typedef CGAL::Delaunay_mesher_2< CDTriangulationPlus, Criteria > Mesher_Base;
typedef CDTriangulationPlus::Vertex_handle Vertex_handle;
typedef std::vector< Vertex_handle > Vertex_handles;
typedef CDTriangulationPlus::Face_handle Face_handle;
typedef CDTriangulationPlus::Point Point;
typedef CGAL::Polygon_2<Kernel> Polygon2D;


有没有办法通过更正代码来消除此警告?

是否尝试了Microsoft推荐的解决方案

这个问题看起来很清楚,解决的方法也很清楚

按照结构的建议将typedef封装在结构中

C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\map(120): error C2220: warning treated as error - no 'object' file generated
10>          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\map(118) : while compiling class template member function 'std::map<_Kty,_Ty,_Pr>::map(const CGAL::Polyline_constraint_hierarchy_2<T,Compare,Data>::Pair_compare &)'
10>          with
10>          [
10>              _Kty=std::pair<CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_with_info_2<ExtPP::CGALMesh::pairInfo,Kernel,CGAL::Triangulation_vertex_base_2<CGAL::Exact_predicates_inexact_constructions_kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vertex_base,Face_base>>>>>,false>,CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_with_info_2<ExtPP::CGALMesh::pairInfo,Kernel,CGAL::Triangulation_vertex_base_2<CGAL::Exact_predicates_inexact_constructions_kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vertex_base,Face_base>>>>>,false>>,
10>              _Ty=std::list<CGAL::Polyline_constraint_hierarchy_2<CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_with_info_2<ExtPP::CGALMesh::pairInfo,Kernel,CGAL::Triangulation_vertex_base_2<CGAL::Exact_predicates_inexact_constructions_kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vertex_base,Face_base>>>>>,false>,CGAL::Pct2_vertex_handle_less_xy<CGAL::Constrained_triangulation_plus_2<CDTriangulation>>,CGAL::Point_2<CGAL::Epick>>::Context> *,
10>              _Pr=CGAL::Polyline_constraint_hierarchy_2<CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_with_info_2<ExtPP::CGALMesh::pairInfo,Kernel,CGAL::Triangulation_vertex_base_2<CGAL::Exact_predicates_inexact_constructions_kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vertex_base,Face_base>>>>>,false>,CGAL::Pct2_vertex_handle_less_xy<CGAL::Constrained_triangulation_plus_2<CDTriangulation>>,CGAL::Point_2<CGAL::Epick>>::Pair_compare,
10>              T=CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_with_info_2<ExtPP::CGALMesh::pairInfo,Kernel,CGAL::Triangulation_vertex_base_2<CGAL::Exact_predicates_inexact_constructions_kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vertex_base,Face_base>>>>>,false>,
10>              Compare=CGAL::Pct2_vertex_handle_less_xy<CGAL::Constrained_triangulation_plus_2<CDTriangulation>>,
10>              Data=CGAL::Point_2<CGAL::Epick>
10>          ]
10>          D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12-beta2\include\CGAL/Polyline_constraint_hierarchy_2.h(204) : see reference to function template instantiation 'std::map<_Kty,_Ty,_Pr>::map(const CGAL::Polyline_constraint_hierarchy_2<T,Compare,Data>::Pair_compare &)' being compiled
10>          with
10>          [
10>              _Kty=std::pair<CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_with_info_2<ExtPP::CGALMesh::pairInfo,Kernel,CGAL::Triangulation_vertex_base_2<CGAL::Exact_predicates_inexact_constructions_kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vertex_base,Face_base>>>>>,false>,CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_with_info_2<ExtPP::CGALMesh::pairInfo,Kernel,CGAL::Triangulation_vertex_base_2<CGAL::Exact_predicates_inexact_constructions_kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vertex_base,Face_base>>>>>,false>>,
10>              _Ty=std::list<CGAL::Polyline_constraint_hierarchy_2<CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_with_info_2<ExtPP::CGALMesh::pairInfo,Kernel,CGAL::Triangulation_vertex_base_2<CGAL::Exact_predicates_inexact_constructions_kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vertex_base,Face_base>>>>>,false>,CGAL::Pct2_vertex_handle_less_xy<CGAL::Constrained_triangulation_plus_2<CDTriangulation>>,CGAL::Point_2<CGAL::Epick>>::Context> *,
10>              _Pr=CGAL::Polyline_constraint_hierarchy_2<CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_with_info_2<ExtPP::CGALMesh::pairInfo,Kernel,CGAL::Triangulation_vertex_base_2<CGAL::Exact_predicates_inexact_constructions_kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vertex_base,Face_base>>>>>,false>,CGAL::Pct2_vertex_handle_less_xy<CGAL::Constrained_triangulation_plus_2<CDTriangulation>>,CGAL::Point_2<CGAL::Epick>>::Pair_compare,
10>              T=CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_with_info_2<ExtPP::CGALMesh::pairInfo,Kernel,CGAL::Triangulation_vertex_base_2<CGAL::Exact_predicates_inexact_constructions_kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vertex_base,Face_base>>>>>,false>,
10>              Compare=CGAL::Pct2_vertex_handle_less_xy<CGAL::Constrained_triangulation_plus_2<CDTriangulation>>,
10>              Data=CGAL::Point_2<CGAL::Epick>
10>          ]
10>          D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12-beta2\include\CGAL/Polyline_constraint_hierarchy_2.h(187) : see reference to class template instantiation 'std::map<_Kty,_Ty,_Pr>' being compiled
10>          with
10>          [
10>              _Kty=std::pair<CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_with_info_2<ExtPP::CGALMesh::pairInfo,Kernel,CGAL::Triangulation_vertex_base_2<CGAL::Exact_predicates_inexact_constructions_kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vertex_base,Face_base>>>>>,false>,CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_with_info_2<ExtPP::CGALMesh::pairInfo,Kernel,CGAL::Triangulation_vertex_base_2<CGAL::Exact_predicates_inexact_constructions_kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vertex_base,Face_base>>>>>,false>>,
10>              _Ty=std::list<CGAL::Polyline_constraint_hierarchy_2<CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_with_info_2<ExtPP::CGALMesh::pairInfo,Kernel,CGAL::Triangulation_vertex_base_2<CGAL::Exact_predicates_inexact_constructions_kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vertex_base,Face_base>>>>>,false>,CGAL::Pct2_vertex_handle_less_xy<CGAL::Constrained_triangulation_plus_2<CDTriangulation>>,CGAL::Point_2<CGAL::Epick>>::Context> *,
10>              _Pr=CGAL::Polyline_constraint_hierarchy_2<CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_with_info_2<ExtPP::CGALMesh::pairInfo,Kernel,CGAL::Triangulation_vertex_base_2<CGAL::Exact_predicates_inexact_constructions_kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vertex_base,Face_base>>>>>,false>,CGAL::Pct2_vertex_handle_less_xy<CGAL::Constrained_triangulation_plus_2<CDTriangulation>>,CGAL::Point_2<CGAL::Epick>>::Pair_compare
10>          ]
10>          D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12-beta2\include\CGAL/Constrained_triangulation_plus_2.h(171) : see reference to class template instantiation 'CGAL::Polyline_constraint_hierarchy_2<T,Compare,Data>' being compiled
10>          with
10>          [
10>              T=CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_with_info_2<ExtPP::CGALMesh::pairInfo,Kernel,CGAL::Triangulation_vertex_base_2<CGAL::Exact_predicates_inexact_constructions_kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vertex_base,Face_base>>>>>,false>,
10>              Compare=CGAL::Pct2_vertex_handle_less_xy<CGAL::Constrained_triangulation_plus_2<CDTriangulation>>,
10>              Data=CGAL::Point_2<CGAL::Epick>
10>          ]
10>          src\ExtPP.cpp(481) : see reference to class template instantiation 'CGAL::Constrained_triangulation_plus_2<Tr_>' being compiled
10>          with
10>          [
10>              Tr_=CDTriangulation
10>          ]
10>C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\map(120): warning C4503: 'std::_Allocator_base<_Ty>' : decorated name length exceeded, name was truncated
10>          with
10>          [
10>              _Ty=std::pair<const std::pair<CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_with_info_2<ExtPP::CGALMesh::pairInfo,Kernel,CGAL::Triangulation_vertex_base_2<CGAL::Exact_predicates_inexact_constructions_kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vertex_base,Face_base>>>>>,false>,CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_with_info_2<ExtPP::CGALMesh::pairInfo,Kernel,CGAL::Triangulation_vertex_base_2<CGAL::Exact_predicates_inexact_constructions_kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vertex_base,Face_base>>>>>,false>>,std::list<CGAL::Polyline_constraint_hierarchy_2<CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_with_info_2<ExtPP::CGALMesh::pairInfo,Kernel,CGAL::Triangulation_vertex_base_2<CGAL::Exact_predicates_inexact_constructions_kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vertex_base,Face_base>>>>>,false>,CGAL::Pct2_vertex_handle_less_xy<CGAL::Constrained_triangulation_plus_2<CDTriangulation>>,CGAL::Point_2<CGAL::Epick>>::Context> *>
10>          ]
10>C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\map(120): warning C4503: 'std::allocator<_Ty>' : decorated name length exceeded, name was truncated
10>          with
10>          [
10>              _Ty=std::pair<const std::pair<CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_with_info_2<ExtPP::CGALMesh::pairInfo,Kernel,CGAL::Triangulation_vertex_base_2<CGAL::Exact_predicates_inexact_constructions_kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vertex_base,Face_base>>>>>,false>,CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_with_info_2<ExtPP::CGALMesh::pairInfo,Kernel,CGAL::Triangulation_vertex_base_2<CGAL::Exact_predicates_inexact_constructions_kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vertex_base,Face_base>>>>>,false>>,std::list<CGAL::Polyline_constraint_hierarchy_2<CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_with_info_2<ExtPP::CGALMesh::pairInfo,Kernel,CGAL::Triangulation_vertex_base_2<CGAL::Exact_predicates_inexact_constructions_kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vertex_base,Face_base>>>>>,false>,CGAL::Pct2_vertex_handle_less_xy<CGAL::Constrained_triangulation_plus_2<CDTriangulation>>,CGAL::Point_2<CGAL::Epick>>::Context> *>
10>          ]
10>C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xtree(2216): warning C4503: 'std::_Tree_unchecked_const_iterator<_Mytree,_Base>' : decorated name length exceeded, name was truncated
10>          with
10>          [
10>              _Mytree=std::_Tree_val<std::_Tree_simple_types<std::pair<const std::pair<CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_with_info_2<ExtPP::CGALMesh::pairInfo,Kernel,CGAL::Triangulation_vertex_base_2<CGAL::Exact_predicates_inexact_constructions_kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vertex_base,Face_base>>>>>,false>,CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_with_info_2<ExtPP::CGALMesh::pairInfo,Kernel,CGAL::Triangulation_vertex_base_2<CGAL::Exact_predicates_inexact_constructions_kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vertex_base,Face_base>>>>>,false>>,std::list<CGAL::Polyline_constraint_hierarchy_2<CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_with_info_2<ExtPP::CGALMesh::pairInfo,Kernel,CGAL::Triangulation_vertex_base_2<CGAL::Exact_predicates_inexact_constructions_kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vertex_base,Face_base>>>>>,false>,CGAL::Pct2_vertex_handle_less_xy<CGAL::Constrained_triangulation_plus_2<CDTriangulation>>,CGAL::Point_2<CGAL::Epick>>::Context> *>>>,
10>              _Base=std::_Iterator_base
10>          ]
10>