You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The change didn't add the default constructor.
I except @flag_enums to model std::regular.
Those already generate a none value initialized with 0 that is the perfect default value.
I was also expecting @enums to model std::regular.
But those don't have a none value,
and the first enumerator, which is initialized with 0, doesn't necessarily represent a default value.
But regularity just makes it easier to work with in some contexts.
Title:
@enum
and@flag_enum
are not models ofstd::regular
.Description:
From #761 (comment):
The change didn't add the default constructor.
I except
@flag_enum
s to modelstd::regular
.Those already generate a
none
value initialized with0
that is the perfect default value.I was also expecting
@enum
s to modelstd::regular
.But those don't have a
none
value,and the first enumerator, which is initialized with
0
, doesn't necessarily represent a default value.But regularity just makes it easier to work with in some contexts.
Minimal reproducer (https://cpp2.godbolt.org/z/v3Ec5zM7r):
Commands:
cppfront main.cpp2 clang++18 -std=c++23 -stdlib=libc++ -lc++abi -pedantic-errors -Wall -Wextra -Wconversion -Werror=unused-result -Werror=unused-value -Werror=unused-parameter -I . main.cpp
Expected result: Both types to model
std::regular
.Actual result and error: Both static assertions failed.
Cpp2 lowered to Cpp1:
Output:
The text was updated successfully, but these errors were encountered: