C++ C++;-未编译的迭代器向量的迭代器
我有一个模板类p,它有一个常量迭代器,我试图用这些迭代器生成一个向量,并遍历该向量:C++ C++;-未编译的迭代器向量的迭代器,c++,templates,iterator,stdvector,C++,Templates,Iterator,Stdvector,我有一个模板类p,它有一个常量迭代器,我试图用这些迭代器生成一个向量,并遍历该向量: std::vector<typename P<A, B>::const_iterator>::const_iterator it; 关于发生这种情况的原因,您有什么想法吗?在std::vector之前还需要一个typename,因为p中至少有一个模板参数是依赖类型: typename std::vector::const_迭代器; 在std::vector之前还需要一个typename
std::vector<typename P<A, B>::const_iterator>::const_iterator it;
关于发生这种情况的原因,您有什么想法吗?在
std::vector
之前还需要一个typename
,因为p
中至少有一个模板参数是依赖类型:
typename std::vector::const_迭代器;
在std::vector
之前还需要一个typename
,因为p
中至少有一个模板参数是依赖类型:
typename std::vector::const_迭代器;
在std::vector
之前还需要一个typename
,因为p
中至少有一个模板参数是依赖类型:
typename std::vector::const_迭代器;
在std::vector
之前还需要一个typename
,因为p
中至少有一个模板参数是依赖类型:
typename std::vector::const_迭代器;
常量迭代器的两种用法都依赖于模板参数;所以两者都需要typename
typename std::vector<typename P<A, B>::const_iterator>::const_iterator it;
^^^^^^^^ ^^^^^^^^
typename std::vector::const_迭代器;
^^^^^^^^ ^^^^^^^^
常量迭代器的两种用法都依赖于模板参数;所以两者都需要typename
typename std::vector<typename P<A, B>::const_iterator>::const_iterator it;
^^^^^^^^ ^^^^^^^^
typename std::vector::const_迭代器;
^^^^^^^^ ^^^^^^^^
常量迭代器的两种用法都依赖于模板参数;所以两者都需要typename
typename std::vector<typename P<A, B>::const_iterator>::const_iterator it;
^^^^^^^^ ^^^^^^^^
typename std::vector::const_迭代器;
^^^^^^^^ ^^^^^^^^
常量迭代器的两种用法都依赖于模板参数;所以两者都需要typename
typename std::vector<typename P<A, B>::const_iterator>::const_iterator it;
^^^^^^^^ ^^^^^^^^
typename std::vector::const_迭代器;
^^^^^^^^ ^^^^^^^^
你能在P中粘贴常量迭代器的typedef吗?我不能=(但我保证它能工作。你能在P中粘贴常量迭代器的typedef吗?我不能=(但我保证它能工作。你能在P中粘贴常量迭代器的typedef吗?我不能。)=(但我保证它能工作。你能把常量迭代器的typedef粘贴到P中吗?我不能=(但我保证它能工作。)。