Skip to content

Revise the declaring/primary constructor proposal #4480

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

Merged
merged 6 commits into from
Aug 8, 2025

Conversation

eernstg
Copy link
Member

@eernstg eernstg commented Jul 31, 2025

This PR changes the declaring/primary constructor proposal to use a different scoping structure, to clarify the placement of the modifier const with a declaring constructor, to mention the principle that the class header should contain all parts of the signature of a declaring constructor if it contains any of them (e.g., class const C(); makes the primary constructor constant, but we can't do class C() { const this; }). Moreover, this PR includes several other minor clarifications and corrections.

@eernstg eernstg requested a review from munificent July 31, 2025 12:24
@eernstg eernstg changed the title Revised the declaring/primary constructor proposal according to the l… Revise the declaring/primary constructor proposal Jul 31, 2025
Copy link
Member

@munificent munificent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! I agree the scoping is unusual. But it's consistent with initializer lists and those seem to have done the right thing in practice for years without user complaint.

@eernstg
Copy link
Member Author

eernstg commented Aug 7, 2025

Thanks for great reviews! More changes are coming tomorrow.

@eernstg eernstg merged commit e76334e into main Aug 8, 2025
4 checks passed
@eernstg eernstg deleted the spec_declaring_fixes_jul25 branch August 8, 2025 14:46
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.

3 participants