-
Notifications
You must be signed in to change notification settings - Fork 35.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
util: Don't throw in GetTime{Millis,Micros}(). Mark as noexcept. #13382
util: Don't throw in GetTime{Millis,Micros}(). Mark as noexcept. #13382
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use std::chrono::high_resolution_clock
?
@qmma70 I'm all for removing Boost, but that is something for another PR :-) |
utACK bcdf285db285932365fe6cae17ba5a585cd1a17e |
The last travis run for this pull request was 55 days ago and is thus outdated. To trigger a fresh travis build, this pull request should be closed and re-opened. |
|
@Empact What in particular is an argument against noexcept here? |
I guess I'm more wondering: what is the justification for it? If it doesn't help with significant performance optimizations (ala |
@Empact Scott Meyers has this to say about |
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
bcdf285
to
afc97c7
Compare
utACK afc97c7 |
Looks like this is made obsolete by something like #9566? |
@MarcoFalke Yes, guess so. Perhaps I should close this PR? The interest in making |
boost::posix_time::ptime(boost::gregorian::date(1970,1,1)
throwsbad_year
,bad_day_of_month
, orbad_day_month
(derivatives ofstd::out_of_range
) if the year, month or day are out of range. It is obvious to us that it won't throw at run-time for1970-01-01
, but that is not obvious for the compiler or static analyzers. From a static analyzer perspective it will look like these exceptions can reach all the way up toNodeImpl::appInitMain()
where they are unhandled.boost::posix_time::from_time_t(0)
is simpler and doesn't throw.boost::posix_time::from_time_t(0)
like we're doing inDecodeDumpTime(…)
.GetTimeMillis()
andGetTimeMicros()
asnoexcept
.