Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: constexpr default constructor #85

Open
burnpanck opened this issue Mar 15, 2024 · 0 comments
Open

Feature: constexpr default constructor #85

burnpanck opened this issue Mar 15, 2024 · 0 comments

Comments

@burnpanck
Copy link

Although in an older issue, it was concluded that general constexpr may be difficult to achieve, I believe there would be considerable benefit in just a constexpr default constructor for the container types and the hooks. Since C++20, we have the constinit specifier for global variables, which means the global can be initialised without running code, which is desirable especially in bare-metal/kernel scenarios, where there is little one can rely on during early boot. However, constinit requires a constexpr constructor, for obvious reasons. Global containers in bare-metal scenarios usually start-off empty, so a default constructor that is constexpr would already go a long way.

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

No branches or pull requests

1 participant