cmext/enum_set: Fix static default construction on older AppleClang versions

AppleClang 8.0 and below do not understand a `= default;` constructor
in static constant default initialization, but do accept `{}`.
This commit is contained in:
Brad King
2025-05-16 14:48:29 -04:00
parent c4b4e26019
commit 2647d97ab7
2 changed files with 8 additions and 1 deletions
+7
View File
@@ -45,6 +45,13 @@ void testDeclaration()
{
std::cout << "testDeclaration()" << std::endl;
{
static EnumSetTest const testSet1;
static EnumSetTest2 const testSet2;
static_cast<void>(testSet1);
static_cast<void>(testSet2);
}
{
EnumSetTest testSet1;
EnumSetTest testSet2 = Test::A;
+1 -1
View File
@@ -149,7 +149,7 @@ public:
using reverse_iterator = std::reverse_iterator<iterator>;
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
constexpr enum_set() noexcept = default;
constexpr enum_set() noexcept {}
enum_set(key_type e) { this->insert(e); }
enum_set(enum_set const& other) noexcept { this->insert(other); }
template <typename E,