/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// C++20 `using enum` declaration isn't supported in GCC 10. Provide a simple // macro until our minimum supported GCC has been upgraded to GCC 11. We can // remove this header and `MOZ_USING_ENUM` after we desupport GCC 10. // // Since few developers will be using GCC locally, they may forget to list all // of the enum's enumerator values and only realize they broke the GCC build // after their patch is backed out of autoland. To catch this error sooner, use // the GCC macro in DEBUG builds on all platforms. // // Usage: // ``` // enum class MyEnum { Foo, Bar, Baz }; // MOZ_USING_ENUM(MyEnum, Foo, Bar, Baz); // // class MyClass { // enum class MyEnum { Foo, Bar, Baz }; // // Use MOZ_USING_ENUM_STATIC in class declarations because the constexpr // // member variables need to be static. This isn't needed for `using enum`. // MOZ_USING_ENUM_STATIC(MyEnum, Foo, Bar, Baz); // }; // ```
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.