- Optimal std::map Key - 2 Updates
- initialization - 1 Update
- convert to a time and compaire to see if more than a minute difference found? - 1 Update
- Would std::runtime_error benefit from having another constructor? - 1 Update
MikeCopeland <mrc2323@cox.net>: Apr 06 03:34PM -0700 I have an std::map with a key that's quite large. The key data is comprised of numeric digits, so I can use either unsigned long or basic::string as the key type. The data range isn't sparse (371920945, 387731336, 388604385, 392868398, etc.). My concern is that with such a large key (as string type), would the map processing be significantly more efficient if the type for the key is declared as "unsigned long"...or does it not matter? TIA --- This email has been checked for viruses by Avast antivirus software. http://www.avast.com |
Ian Collins <ian-news@hotmail.com>: Apr 07 10:45AM +1200 MikeCopeland wrote: > a large key (as string type), would the map processing be significantly > more efficient if the type for the key is declared as "unsigned > long"...or does it not matter? TIA Why would you represent a numeric key as a string? -- Ian Collins |
David Brown <david.brown@hesbynett.no>: Apr 06 11:53PM +0200 On 29/03/15 04:51, Öö Tiib wrote: >> without having set it. > Compilers do not typically warn if you pass uninitialied variable to > function by non-const reference or pointer. Just because compilers can't check /everything/, does not mean you should ignore the checks they /can/ do! But I agree that sometimes using an "unavailable" or known-bad value is a good choice for initialisation when you don't have a real valid value. |
scott@slp53.sl.home (Scott Lurndal): Apr 06 01:40PM >I'm parsing a few million lines of log files and trying to sort things out. >My log files begin with stuff like: >2015-03-23 11:56:03,752 On a posix platform, use 'strptime'. |
woodbrian77@gmail.com: Apr 05 08:02PM -0700 On Sunday, April 5, 2015 at 4:41:00 PM UTC-5, Öö Tiib wrote: > To my knowledge that has changed since C++11 and now > 'std::runtime_error' has two constructors, one that > takes 'std::string const&' and other that takes 'char const*'. OK. I thought I was looking at the documentation for C++ 2011, but it was the 1998 documentation. Sorry about that. Maybe I'll start using cppreference.com more. Brian Ebenezer Enterprises http://webEbenezer.net |
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page. To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com. |
No comments:
Post a Comment