What is the best way to map two values to one key?
ie An item with a value and bool.
Tried using:
std::map
That is indeed the correct solution. More generally, consider using std::tuple
instead of std::pair
for a uniform interface regardless of the number of values (as std::pair
is obviously restricted to two), or boost::tuple if your compiler is too old to ship with a std::
or std::tr1::
implementation.