C++ 不完整类型错误(E0409、E0070、E0515)

C++ 不完整类型错误(E0409、E0070、E0515),c++,tuples,incomplete-type,C++,Tuples,Incomplete Type,在我的代码Main.cpp中,我有如下所示。我遇到的问题是使用tuple 我一直在犯这三个错误 函数“sPA”返回不完整类型“trie”,不允许不完整类型,以及 无法转换为不完整的类“trie” 我在这里做错了什么来犯这个错误 // Main.cpp #include <iostream> #include <string> using namespace std; typedef pair<int, int> int_pair; typedef

在我的代码
Main.cpp
中,我有如下所示。我遇到的问题是使用
tuple
我一直在犯这三个错误

函数“sPA”返回不完整类型“trie”
不允许不完整类型
,以及
无法转换为不完整的类“trie”

我在这里做错了什么来犯这个错误

 // Main.cpp
 #include <iostream>
 #include <string>
 using namespace std;

 typedef pair<int, int> int_pair;
 typedef tuple<int, int, int> trie;



 int_pair sum_and_product(int a, int b) {
     return int_pair(a + b, a * b);
 }

 trie sPA(int a, int b, int c) {
     trie t{ a + b + c,a * b * c,((a + b + c) / 3) };
     return t;
 } 

 void consuming_templates() {
     int a = 2, b = 3, c = 4;
     auto results = sum_and_product(a,b);
     cout << "sum = " << results.first << "|product = " << results.second << endl;
     auto r2 = sPA(a, b, c);
 }

int main(int argc, char* argv[]) {

    consuming_templates();

    return 0;
}
//Main.cpp
#包括
#包括
使用名称空间std;
typedef对int_对;
typedef元组trie;
整数对和积(整数a,整数b){
返回整数对(a+b,a*b);
}
特里亚温泉酒店(a区、b区、c区){
triet{a+b+c,a*b*c,((a+b+c)/3)};
返回t;
} 
无效使用模板(){
INTA=2,b=3,c=4;
自动结果=总和和乘积(a,b);

coutIDCLEV463035818和M.M已经发布了评论来回答我的问题


您需要执行
#include
#include

您的代码中是否包含include?请在此处也包含它们您必须包含
,我相信
pair
位于
@idclev463035818
*注意:库头通常会包含类型的转发声明,而不是includee类型的标题,因为转发声明的编译速度比大多数用户不需要的标题快得多。如果您需要的不仅仅是对的引用,而且没有包含正确的标题,则会导致类似的错误。好的,您应该能够将答案(而不是问题)标记为“社区wiki”(这是写其他人在评论中发布的答案时的正常礼仪,而他们并不是真的打算这么做)。虽然我不确定这是否会绕过2天接受时间My bad,但在没有
的情况下我没有任何错误,因此我认为这只是
,因为它在没有任何
元组的情况下运行正常
标准头可能包括其他标准头,但不需要