I want to create a map with the timestamp keyword and two other elements. So I thought something like this:
std::map<time_t,std::pair<long,int>> someContainer;
1) I need a timestamp type, which is a nanosecond resolution, I have seen boost::chrono::high_resolution_clock, but I don’t think it will give a nanosecond resolution, and if possible, can I use it as a type inside the map?
2) How to add a new item to this card? As far as I know, insertdoes not accept 3 parameters. I do not know the correct syntax for this operation.
3) I have to do a very quick search using a key (which is a timestamp in my case), so std::mapis this a suitable container for this purpose?
By the way, I work in Visual Studio 2008, Visual C ++ on a Win 7 x64 computer ...
Thanks, really ...
source
share