Summary: | [WTF] Annotate Seconds' member functions and operators with constexpr | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Yusuke Suzuki <ysuzuki> | ||||||||
Component: | New Bugs | Assignee: | Yusuke Suzuki <ysuzuki> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | benjamin, buildbot, cdumez, cmarcelo, commit-queue, dbates, sam | ||||||||
Priority: | P2 | ||||||||||
Version: | WebKit Nightly Build | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Attachments: |
|
Description
Yusuke Suzuki
2017-04-09 17:41:49 PDT
Created attachment 306638 [details]
Patch
Created attachment 306639 [details]
Patch
Created attachment 306640 [details]
Patch
Comment on attachment 306640 [details]
Patch
r=me
Comment on attachment 306640 [details]
Patch
Thanks!
Comment on attachment 306640 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=306640&action=review > Source/WTF/wtf/MathExtras.h:200 > + return (value >= static_cast<double>(max)) ? max : ((value <= static_cast<double>(min)) ? min : static_cast<T>(value)); I take to that we must support one or more compilers that do not support C++14 extended constexpr and hence had to rewrite this function to have a single return statement. Comment on attachment 306640 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=306640&action=review >> Source/WTF/wtf/MathExtras.h:200 >> + return (value >= static_cast<double>(max)) ? max : ((value <= static_cast<double>(min)) ? min : static_cast<T>(value)); > > I take to that we must support one or more compilers that do not support C++14 extended constexpr and hence had to rewrite this function to have a single return statement. Right. At least, WebKitGTK+ needs to support GCC 4.9 now, which does not support C++14 relaxed constexpr. Once C++14 relaxed constexpr is allowed, the above code will be much simplified. Comment on attachment 306640 [details] Patch Clearing flags on attachment: 306640 Committed r215169: <http://trac.webkit.org/changeset/215169> All reviewed patches have been landed. Closing bug. Thanks for doing this. I’ll use it in my next patch. |