【发布时间】:2016-02-09 04:51:17
【问题描述】:
所以我有课
template<typename edge_val_type>
class Graph {
struct edge {
int index_;
edge_val_type v_;
edge(int index, edge_val_type v) : index_(index), v_(v) {}
}
如何将v_ 初始化为某个默认值?因为此时程序不知道edge_val_type 是什么。
【问题讨论】:
-
回复的编辑在发布答案后更改了问题。
标签: c++ templates constructor initialization