WebKit Bugzilla
Attachment 339539 Details for
Bug 185298
: OptionsSet initializer list constructor should be constexpr
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
optionset-constexpr.patch (text/plain), 1.62 KB, created by
Antti Koivisto
on 2018-05-04 06:52:43 PDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Antti Koivisto
Created:
2018-05-04 06:52:43 PDT
Size:
1.62 KB
patch
obsolete
>Index: Source/WTF/ChangeLog >=================================================================== >--- Source/WTF/ChangeLog (revision 231351) >+++ Source/WTF/ChangeLog (working copy) >@@ -1,3 +1,11 @@ >+2018-05-04 Antti Koivisto <antti@apple.com> >+ >+ OptionsSet initializer list constructor should be constexpr >+ https://bugs.webkit.org/show_bug.cgi?id=185298 >+ >+ * wtf/OptionSet.h: >+ (WTF::OptionSet::OptionSet): >+ > 2018-05-03 Yusuke Suzuki <utatane.tea@gmail.com> > > Use default std::optional if it is provided >Index: Source/WTF/wtf/OptionSet.h >=================================================================== >--- Source/WTF/wtf/OptionSet.h (revision 231351) >+++ Source/WTF/wtf/OptionSet.h (working copy) >@@ -78,16 +78,19 @@ public: > : m_storage(static_cast<StorageType>(t)) > { > } >+ >+ constexpr OptionSet(std::initializer_list<T> initializerList) >+ { >+ for (auto& option : initializerList) >+ m_storage |= static_cast<StorageType>(option); >+ } > #else > OptionSet(T t) > : m_storage(static_cast<StorageType>(t)) > { > ASSERT_WITH_MESSAGE(hasOneBitSet(static_cast<StorageType>(t)), "Enumerator is not a positive power of two."); > } >-#endif > >- // FIXME: Make this constexpr once we adopt C++14 as C++11 does not support for-loops >- // in a constexpr function. > OptionSet(std::initializer_list<T> initializerList) > { > for (auto& option : initializerList) { >@@ -95,6 +98,7 @@ public: > m_storage |= static_cast<StorageType>(option); > } > } >+#endif > > constexpr StorageType toRaw() const { return m_storage; } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
andersca
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185298
: 339539