I’m trying to make a tuple, so I wrote the following:
tuple<int, int, string> tup = make_tuple(1,2,"done");
Its giving me the following error:
error: variable ‘std::tuple<int, int, std::__cxx11::basic_string<char, std::char_traits, std::allocator > > tup’ has initializer but incomplete type
22 | tuple<int, int, string> tup = make_tuple(1,2,“done”);
| ^
So after some Googling, I found that if I added this to the top it would work:
#include <bits/stdc++.h>
After some more Googling, I found that adding that is bad practice. So I started looking for the actual thing to import. Many recommended using this:
#include <sstream>
However, that also doesn’t work. I’m not sure what I’m doing wrong. Here is the full code for reference:
#include
#include
#include
using namespace std;
int main(){
//Tuples are with more things
tuple<int, int, string> tup = make_tuple(1,2,"done");
return 0;
}
Please let me know what I did wrong.
Thanks!