简体   繁体   English

C ++中元组的代码块错误

[英]Codeblock error for tuple in c++

I have written the following code in Codeblocks (C++): 我已经在代码块(C ++)中编写了以下代码:

#include <bits/stdc++.h>
using namespace std;
int main(void)
{
    vector<int> v;
    tuple<int,int,int> t1 = make_tuple(1,2,3)
    tuple<char,int,double,int,long long int >t2;
    t2=make_tuple( 'a' , 2 , 2.3 , 1 , 10000 );
    cout<< get<2>t1 << " "<< get<0> t2;// will print 3 and 'a'
}

When I prompt to compile, it shows many errors. 当我提示编译时,它显示许多错误。 One error is: 一个错误是:

 no match for 'operator<<' (operand types are 'std::ostream {aka std::basic_ostream<char>}' and '<unresolved overloaded function type>')|

Can anyone tell me what is the reason? 谁能告诉我原因是什么? Am I missing any library files? 我是否缺少任何库文件?

get<x> y必须是get<x>(y)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM