I would like to store boost::gregorian::date
as key of a boost::unordered_map
but I cannot compile the code as it is missing a proper hash function for this class.
- An easy solution would be converting to
std::string
and store it. I possibly would like to avoid this solution as using string is quite expensive. - I tried to find some function exporting a date to number but I can read only the
day()
function and I am not sure if this is really suitable. - Maybe I can calculate the number of days between my date and a reference date?
Is there any other better way to store date or a function exporting date as number?