I'm trying to construct a set of tuples (i, v)
, where i
is an int
and v
is a double
. The set cannot contain two tuples with the same value of i
.
To do this, I think I should use a std::set
of std:tuple
s. Something like:
#include <tuple>
#include <set>
using namespace std;
set<tuple<int, double>> mySet;
The std::set
class allows me to specify a comparator, and I think I should use this to avoid different tuples with the same value of i
, but I don't know how to do it??