Changeset 231353 in webkit


Ignore:
Timestamp:
May 4, 2018 8:35:29 AM (6 years ago)
Author:
Antti Koivisto
Message:

OptionsSet initializer list constructor should be constexpr
https://bugs.webkit.org/show_bug.cgi?id=185298

Reviewed by Anders Carlsson.

  • wtf/OptionSet.h:

(WTF::OptionSet::OptionSet):

Location:
trunk/Source/WTF
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r231342 r231353  
     12018-05-04  Antti Koivisto  <antti@apple.com>
     2
     3        OptionsSet initializer list constructor should be constexpr
     4        https://bugs.webkit.org/show_bug.cgi?id=185298
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * wtf/OptionSet.h:
     9        (WTF::OptionSet::OptionSet):
     10
    1112018-05-03  Yusuke Suzuki  <utatane.tea@gmail.com>
    212
  • trunk/Source/WTF/wtf/OptionSet.h

    r225142 r231353  
    7979    {
    8080    }
     81
     82    constexpr OptionSet(std::initializer_list<T> initializerList)
     83    {
     84        for (auto& option : initializerList)
     85            m_storage |= static_cast<StorageType>(option);
     86    }
    8187#else
    8288    OptionSet(T t)
     
    8591        ASSERT_WITH_MESSAGE(hasOneBitSet(static_cast<StorageType>(t)), "Enumerator is not a positive power of two.");
    8692    }
    87 #endif
    8893
    89     // FIXME: Make this constexpr once we adopt C++14 as C++11 does not support for-loops
    90     // in a constexpr function.
    9194    OptionSet(std::initializer_list<T> initializerList)
    9295    {
     
    9699        }
    97100    }
     101#endif
    98102
    99103    constexpr StorageType toRaw() const { return m_storage; }
Note: See TracChangeset for help on using the changeset viewer.