-
-
Notifications
You must be signed in to change notification settings - Fork 379
spec: class: add __ctor, __dtor and __xdtor aliases #3125
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -258,6 +258,11 @@ void test() | |||||
syntax) refers to the ability to call a function as if it were a method of | ||||||
its first argument. For example `funct(arg)` may be written as | ||||||
`arg.funct()`.) | ||||||
|
||||||
$(DT $(LNAME2 inclusive_destructor, inclusive-destructor, Inclusive | ||||||
Destructor)) | ||||||
$(DD An inclusive destructor is a destructor that includes destruction | ||||||
of the object itself and its fields, if reaching its lifetime.) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Destructors can be called early (for example, by |
||||||
) | ||||||
|
||||||
) | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -371,6 +371,9 @@ $(GNAME Constructor): | |||||
} | ||||||
------ | ||||||
|
||||||
$(P The compiler generate a $(D __ctor) alias that matches with | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
constructors definitions.) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't really understand what you mean by this sentence. Could you please elaborate? |
||||||
|
||||||
$(H3 $(LNAME2 delegating-constructors, Delegating Constructors)) | ||||||
|
||||||
$(P A constructor can call another constructor for the same class | ||||||
|
@@ -729,6 +732,11 @@ $(GNAME Destructor): | |||||
by the gc. | ||||||
) | ||||||
|
||||||
$(P The compiler generates $(D __dtor) and $(D __xdtor) aliases that | ||||||
matches the class destructor definition and inclusive destructors, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is the term "inclusive destructor" defined elsewhere in the spec? If not I think it should have a definition somewhere. I note that
However, I note that this wording seems to be descriptive rather than prescriptive, which isn't ideal for the language specification. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added the About the |
||||||
respectively.) | ||||||
|
||||||
|
||||||
$(H2 $(LNAME2 static-constructor, Static Constructors)) | ||||||
|
||||||
$(GRAMMAR | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.