Skip to content

Commit 42fadd8

Browse files
committed
[spec] Improve property docs (part 2)
Move class table to class.dd. Add subheading for tupleof, update links. Add links to other properties. Remove struct sizeof as sizeof is for all types.
1 parent a1bcc0c commit 42fadd8

File tree

4 files changed

+23
-15
lines changed

4 files changed

+23
-15
lines changed

spec/class.dd

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,19 @@ $(H3 $(LNAME2 field_properties, Field Properties))
171171

172172
$(H2 $(LNAME2 class_properties, Class Properties))
173173

174+
$(TABLE2 Class Instance Properties,
175+
$(THEAD Property, Description)
176+
$(TROW $(DDSUBLINK spec/property, classinfo, $(D .classinfo)),
177+
Information about the dynamic type of the class.)
178+
$(TROW $(RELATIVE_LINK2 outer-property, `.outer`), $(ARGS For
179+
a nested class instance, provides either the parent class instance,
180+
or the parent function's context pointer when there is no parent
181+
class.))
182+
$(TROW $(D .tupleof), See below.)
183+
)
184+
185+
$(H3 $(LNAME2 tupleof, `.tupleof`))
186+
174187
$(P The $(D .tupleof) property is an
175188
$(DDSUBLINK spec/template, homogeneous_sequences, lvalue sequence)
176189
of all the non-static fields in the class, excluding the hidden fields and
@@ -208,11 +221,6 @@ void main()
208221

209222
$(H3 $(LNAME2 hidden-fields, Accessing Hidden Fields))
210223

211-
$(P The $(RELATIVE_LINK2 outer-property, `.outer` property) for
212-
a nested class instance provides either the parent class instance,
213-
or the parent function's context pointer when there is no parent
214-
class.)
215-
216224
$(P The properties $(D .__vptr) and $(D .__monitor) give access
217225
to the class object's vtbl[] and monitor, respectively, but
218226
should not be used in user code.

spec/property.dd

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,13 @@ $(TROW $(D (2.5F).nan), yields the floating point NaN value)
6363

6464
$(BR)
6565

66-
$(TABLE2 Properties for Class Types,
67-
$(THEAD Property, Description)
68-
$(TROW $(RELATIVE_LINK2 classinfo, $(D .classinfo)), Information about the dynamic type of the class)
69-
)
70-
71-
$(P See also: $(DDSUBLINK spec/enum, enum_properties, Enum Properties).)
66+
$(P See also:)
67+
* $(DDSUBLINK spec/arrays, array-properties, Array Properties)
68+
* $(DDSUBLINK spec/class, class_properties, Class Properties)
69+
* $(DDSUBLINK spec/hash-map, properties, Associative Array Properties)
70+
* $(DDSUBLINK spec/enum, enum_properties, Enum Properties)
71+
* $(DDSUBLINK spec/struct, struct_properties, Struct Properties)
72+
* $(DDSUBLINK spec/simd, properties, Vector Properties)
7273

7374

7475
$(H2 $(LNAME2 init, .init Property))

spec/struct.dd

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -601,9 +601,8 @@ assert(u.c == false); // no overlap
601601

602602
$(H2 $(LNAME2 struct_properties, Struct Properties))
603603

604-
$(TABLE2 Struct Properties,
604+
$(TABLE2 Struct Type Properties,
605605
$(THEAD Name, Description)
606-
$(TROW $(D .sizeof), Size in bytes of struct)
607606
$(TROW $(D .alignof), Size boundary struct needs to be aligned on)
608607
)
609608

@@ -613,7 +612,7 @@ $(TABLE2 Struct Instance Properties,
613612
$(THEAD Name, Description)
614613
$(TROW $(D .tupleof), An $(DDSUBLINK spec/template, homogeneous_sequences, lvalue sequence)
615614
of all struct fields - see
616-
$(DDSUBLINK spec/class, class_properties, Class Properties) for a class-based example.)
615+
$(DDSUBLINK spec/class, tupleof, here) for a class-based example.)
617616
)
618617

619618
$(H3 $(LNAME2 struct_field_properties, Struct Field Properties))

spec/template.dd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ $(H4 $(LNAME2 lvalue-sequences, Lvalue Sequences))
978978
)
979979

980980
$(UL
981-
$(LI `.tupleof` can be $(DDSUBLINK spec/class, class_properties, used on a class)
981+
$(LI `.tupleof` can be $(DDSUBLINK spec/class, tupleof, used on a class)
982982
or struct instance to obtain an lvalue sequence of its fields.)
983983
$(LI `.tupleof` can be $(DDSUBLINK spec/arrays, array-properties, used on a static array)
984984
instance to obtain an lvalue sequence of its elements.)

0 commit comments

Comments
 (0)