Skip to content

Commit c08a41f

Browse files
authored
[trivial] [spec] Use 'scope class instance` throughout (#3669)
Instead of 'scope object' or 'scope variable' because a reference can be scope without being stack allocated.
1 parent 3f5605b commit c08a41f

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

spec/attribute.dd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -880,9 +880,9 @@ $(P
880880
In that case, they are inferred as $(DDSUBLINK spec/function, return-scope-parameters, Return Scope Parameters).
881881
)
882882

883-
$(H3 $(LNAME2 scope-class-var, $(D scope) variables with `class` type))
883+
$(H3 $(LNAME2 scope-class-var, $(D scope) Class Instances))
884884
$(P
885-
When used on variables with a `class` type, `scope` signifies the RAII
885+
When used to allocate a class instance directly, a `scope` variable signifies the RAII
886886
(Resource Acquisition Is Initialization) protocol.
887887
This means that the destructor for an object is automatically called when the
888888
reference to it goes out of scope. The destructor is called even

spec/class.dd

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,8 @@ $(H3 $(LNAME2 class-instantiation, Class Instantiation))
497497
A a = new A(3);
498498
------
499499

500-
$(P A $(DDSUBLINK spec/attribute, scope-class-var, `scope` object) can be allocated on the stack.)
500+
$(P A $(DDSUBLINK spec/attribute, scope-class-var, `scope` class instance)
501+
is allocated on the stack.)
501502

502503
$(P The following steps happen:)
503504

@@ -719,7 +720,7 @@ $(GNAME Destructor):
719720

720721
$(P The destructor function is called when the object
721722
is deleted by the garbage collector, or when a
722-
$(DDSUBLINK spec/attribute, scope-class-var, `scope` object) goes out of scope.
723+
$(DDSUBLINK spec/attribute, scope-class-var, `scope` class instance) goes out of scope.
723724
The syntax is:)
724725

725726
------
@@ -1039,7 +1040,7 @@ $(GNAME Invariant):
10391040

10401041
$(H2 $(LNAME2 auto, Scope Classes))
10411042
$(NOTE Scope classes have been $(DDSUBLINK deprecate, scope as a type constraint, deprecated). See also
1042-
$(DDSUBLINK spec/attribute, scope-class-var, `scope` objects).)
1043+
$(DDSUBLINK spec/attribute, scope-class-var, `scope` class instances).)
10431044

10441045
$(P A scope class is a class with the $(D scope) attribute, as in:)
10451046

0 commit comments

Comments
 (0)