Added size() method
This commit is contained in:
@@ -31,9 +31,19 @@ namespace lms::core
|
||||
Two,
|
||||
};
|
||||
|
||||
{
|
||||
constexpr EnumSet<Foo> test;
|
||||
|
||||
static_assert(test.size() == 0);
|
||||
static_assert(test.empty());
|
||||
static_assert(!test.contains(Foo::One));
|
||||
static_assert(!test.contains(Foo::Two));
|
||||
}
|
||||
|
||||
{
|
||||
constexpr EnumSet<Foo> test{ Foo::One };
|
||||
|
||||
static_assert(test.size() == 1);
|
||||
static_assert(!test.empty());
|
||||
static_assert(test.contains(Foo::One));
|
||||
static_assert(!test.contains(Foo::Two));
|
||||
@@ -49,6 +59,8 @@ namespace lms::core
|
||||
constexpr EnumSet<Foo> test{ Foo::One, Foo::Two };
|
||||
constexpr auto bitfield{ test.getBitfield() };
|
||||
|
||||
static_assert(test.size() == 2);
|
||||
|
||||
EnumSet<Foo> test2;
|
||||
EXPECT_FALSE(test2.contains(Foo::One));
|
||||
EXPECT_FALSE(test2.contains(Foo::Two));
|
||||
|
||||
Reference in New Issue
Block a user