在下面的C++代码中,有人能解释一下私有部分每行是什么意思吗?我已经尝试过查找,但仍然无法理解它们的作用。
我知道
我知道
using
在C中等同于typedef
。因此:using the_graph = graph<T_node, T_edge1, T_allocator, T_size>;
这意味着你正在使用the_graph
。
但在这种情况下,为什么要在其上调用作用域解析运算符呢?
我认为它不是这里描述的 4 种方法之一。
template <class T_node, class T_edge1, class T_edge2, class T_allocator, class T_size = uint32_t>
class graph : private virtual graph<T_node, T_edge1, T_allocator, T_size>, private virtual graph<T_node, T_edge2, T_allocator, T_size>
{
public:
using the_graph = graph<T_node, T_edge1, T_allocator, T_size>;
private:
using typename the_graph::node_list_iterator;
using the_graph::node_begin;
};