Skip to content

Use explicit enum default value instead of Default trait#157

Merged
nunoplopes merged 1 commit into
Cpp2Rust:masterfrom
lucic71:enum-default
May 27, 2026
Merged

Use explicit enum default value instead of Default trait#157
nunoplopes merged 1 commit into
Cpp2Rust:masterfrom
lucic71:enum-default

Conversation

@lucic71
Copy link
Copy Markdown
Contributor

@lucic71 lucic71 commented May 27, 2026

Default::default() cannot be used in const context, for example initializing a global variable. For this reason, switch the initialization of enum from <EnumName>::default() to <EnumName>::EXPLICIT_DEFAULT_VALUE.

@nunoplopes nunoplopes merged commit b82338e into Cpp2Rust:master May 27, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants