简体   繁体   中英

Codeblock error for tuple in c++

I have written the following code in Codeblocks (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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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