不完整类型不允许错误和元组

问题描述 投票:3回答:2

所以我面临这个错误

不允许使用不完整的类型

#include "stdafx.h"
#include <iostream>
#include <conio.h>
#include <ctype.h>
#include <sstream>
using namespace std;

int main()
{
    std::tuple<int, bool, float> human = {345, true, 2.33}; 
    // Incomplete type is not allowed  

    system("pause");
    return 0;
}

任何线索?

c++ visual-c++ std
2个回答
14
投票

你需要#include <tuple>才能使用它。


0
投票

头文件尚未包含在内。

© www.soinside.com 2019 - 2024. All rights reserved.