c++ - Division_Euclidean_space.h 错误 : ‘vertex_t’ is not a type

标签 c++ boost

<分区>

我有这个类,但我只在 BOOST 情况下收到错误。

template<typename T>
class Division_Euclidean_space {
 public:
  typedef T FT;

#ifdef RKD_WITH_BOOST
 struct Vertex{ std::vector<FT> v;};
 typedef struct Vertex Vertex;

 typedef boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, Vertex > Graph;
 typename boost::graph_traits<Graph>::vertex_descriptor vertex_t;
#endif

#ifdef RKD_WITH_BOOST
  void insert(Graph& g, vertex_t& v) {
        for(int i = 0; i < g[v].v.size(); ++i)
            p.push_back(g[v].v[i]);
  }
#endif
...

我实际上遇到了很多错误,但我相信如果我解决这个问题,我会没事的

Division_Euclidean_space.h:102:25: error: ‘vertex_t’ is not a type

最佳答案

typename boost::graph_traits<Graph>::vertex_descriptor vertex_t;声明一个变量。

你的意思可能是:

typedef typename boost::graph_traits<Graph>::vertex_descriptor vertex_t;

关于c++ - Division_Euclidean_space.h 错误 : ‘vertex_t’ is not a type,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27643309/

相关文章:

c++ - 为什么将 CString 转换为 wchar_t* 会产生一个临时拷贝?如果我们使用其他类型而不是 CString 会怎样?

c++ - 我怎样才能 "double overload"一个运算符(operator)?

c++ - 如何判断一个进程 "virtual size"(WinXP)?

C++ 我可以在没有计时器的情况下制作 boost::asio 连接套接字吗?

c++ - 在 c++/g++ 中提取 html 文件的外部链接

c++ - 这个初始化列表是什么意思?

c++ - 如何使用 boost::process 向子进程发送 SIGTERM

c++ - 使用 Boost 对具有 const 成员的类进行序列化

c++ - 使用 MSVC 14.0 (VS 2015) 编译 Boost 时编译器版本未知

c++ - Boost::ASIO HTTP POST 中的空主体