Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
4 votes
2 answers
152 views

I'm building a small regex VM that matches text with bytecode-like instructions. Take the following enum: pub type Pc = usize; pub enum Inst { Char(char, Pc), Range(char, char, Pc), Any(...
5 votes
1 answer
186 views

I'm working on a C99 project that is required to follow the MISRA C:2012 standard. Whenever I use an enumeration type, I get a violation of rule 10.4 or 10.5. As a static analysis tool, I use the code ...
1 vote
0 answers
59 views

According to cppreference, it is allowed to define an unscoped enum value by using prior values of the same enum, e.g. like this: enum MyEnum_U { u_foo = 2, u_bar = 5, u_baz = u_foo + ...
Thibe's user avatar
  • 758
1 vote
2 answers
90 views

In Python, an enum member carries an underlying value, which can be obtained by reading the value attribute. Conversely, an enum member can be obtained from its value by calling the enum type. class ...
dumbass's user avatar
  • 27.2k
15 votes
1 answer
751 views

I noticed a discrepancy between C++23 and C++26 code when using googlemock: enum A { A1, A2 }; enum B { B1, B2 }; TEST(...) { ASSERT_EQ(A1, B1); // compiles fine in C++23 and C++26 ASSERT_THAT(...
PiotrNycz's user avatar
  • 25.2k
1 vote
6 answers
276 views

I've been studying Java for some time now to better understand what goes on inside some of the code parts. While studying Enum, which I am used to using exclusively for listing various fixed values (...
Ice K's user avatar
  • 37
Advice
0 votes
0 replies
26 views

I'm trying to generate a C# client from the OpenRouter OpenAPI spec: https://github.com/OpenRouterTeam/typescript-sdk/blob/main/.speakeasy/in.openapi.yaml Among other things there are some enums ...
k2042's user avatar
  • 1
1 vote
0 answers
62 views

I've been struggling for two days with a PostgreSQL enum type issue in Entity Framework Core. Despite all my configuration, EF Core keeps trying to send a string (`text`) to an enum column. The ...
1 vote
1 answer
118 views

Given the base class: public abstract class EnumType<TEnum, TValue> where TEnum : struct, IConvertible where TValue : struct { public abstract TEnum GetEnumValue(TValue value); } ...
Weifen Luo's user avatar
2 votes
3 answers
194 views

The C++ Coding guidelines, Enum.3: Prefer class enums over "plain" enums contains following example: void Print_color(int color); enum Web_color { red = 0xFF0000, green = 0x00FF00, blue = 0x0000FF }; ...
Erik Man's user avatar
  • 874
0 votes
2 answers
159 views

Clang's -Wassign-enum diagnostic flag will trigger a warning when using an int whose value is out of scope of an enum's cases: typedef enum Foo { FooA, FooB, } Foo; void handleFoo(Foo foo); ...
an0's user avatar
  • 17.6k
0 votes
1 answer
132 views

I have a RecylcerView List of CardViews. Each CardView holds user data that is saved in a Room database. Some of the CardViews have due dates that have been entered by the user with a TimePicker. I ...
1 vote
0 answers
52 views

I am in a scenario (that could be compared to writing an AST) where I compile multiple regex patterns that I want to reuse later, and for the sake of simplicity and readability I want to store them in ...
0 votes
0 answers
46 views

I have an ENUM with some documentation about the values ("Description 1", "Description 2"): ENUM(MyEnum, v_int32, VALUE(VAL1, 3, "ME_VAL1", "Description 1"),...
Jaanus Sepp's user avatar
2 votes
2 answers
183 views

Niche optimization allows Rust to store data in the invalid bit patterns of a type. The only valid values of a bool are 0 and 1 (one bit). And Result only has two variants (one bit). So why does ...

15 30 50 per page
1
2 3 4 5
...
1524

AltStyle によって変換されたページ (->オリジナル) /