Trying to learn C++ coming from Python, and in python a set can have multiple types. How do I do this in C++? I'm specifically trying to have a set with both integers and strings. For example:
#include <set>
#include <string>
using namespace std;
int main() {
set<int, string> s;
s.insert(1);
s.insert("string");
}
Aucun commentaire:
Enregistrer un commentaire