// Copyright 2019 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef V8_BASE_ENUM_SET_H_ #define V8_BASE_ENUM_SET_H_ #include <ostream> #include <type_traits> #include "src/base/bits.h" #include "src/base/logging.h" namespace v8 { namespace base { // A poor man's version of STL's bitset: A bit set of enums E (without explicit // values), fitting into an integral type T. template <class E, class T = int> class EnumSet { … }; template <typename E, typename T> std::ostream& operator<<(std::ostream& os, EnumSet<E, T> set) { … } } // namespace base } // namespace v8 #endif // V8_BASE_ENUM_SET_H_