几周前我开始使用模板,但我在使用它时遇到了麻烦。我收到了这个错误:
Freestyle/_gl/../_convection_selective/Definitions.h:153:9: 错误: '<strong>Node_handle' in 'Point_set {aka struct Kd_tree_patch > >*, My_point_property_map, CGAL::Search_traits > >, const double*, Construct_coord_iterator > > >}'没有命名类型
在编译此代码时:
“定义.h”:
#include "Kd_tree_patch.h"
[...]
template <class SearchTraits, class Splitter_= CGAL::Sliding_midpoint<SearchTraits>, class UseExtendedNode = CGAL::Tag_true > class Kd_tree_patch; //forward declaration
typedef Kd_tree_patch<Search_traits> Point_set;
typedef Point_set::Node_handle Node_handle;
“Kd_tree_patch.h”:
template <class SearchTraits, class Splitter_=Sliding_midpoint<SearchTraits>, class UseExtendedNode = Tag_true >
class Kd_tree_patch {
[...]
typedef Kd_tree_node<SearchTraits, Splitter, UseExtendedNode > Node;
typedef typename Compact_container<Node>::iterator Node_handle;
};
为什么 Node_handle 还没有被视为一种类型?
谢谢你的帮助。