Wednesday, 11 September 2013

Add things to an std::map by time range but interrogate by time value

Add things to an std::map by time range but interrogate by time value

I am setting up an std::map object that links a series of time ranges (the
key) to objects.
It is my intention to ensure that no two overlapping time range values can
be added into this map - I know I can do this by creating a comparer
function that returns true if there's an overlap and passing this in as
the third comparer template item to the std::map.
However, I would like to look up the values based on a single point in
time, not a range.
I think I need to override an operator but I'm not sure which - any ideas?
I need to be a bit quick as I think the office is about to close so
apologies for any lack of detail/code.

No comments:

Post a Comment