Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/155.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ C++;-未编译的迭代器向量的迭代器_C++_Templates_Iterator_Stdvector - Fatal编程技术网

C++ C++;-未编译的迭代器向量的迭代器

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

我有一个模板类p,它有一个常量迭代器,我试图用这些迭代器生成一个向量,并遍历该向量:

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中吗?我不能=(但我保证它能工作。)。