Skip to content

Commit 1507233

Browse files
authored
[spec/type] Add example for derived types (#3904)
Add item for type sequences.
1 parent a9a060d commit 1507233

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

spec/type.dd

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,23 @@ $(H2 $(LEGACY_LNAME2 Derived Data Types, derived-data-types, Derived Data Types)
145145
$(LI $(DDLINK spec/hash-map, Associative Array, Associative Arrays))
146146
$(LI $(RELATIVE_LINK2 functions, Function Types))
147147
$(LI $(RELATIVE_LINK2 delegates, Delegate Types))
148+
$(LI $(DDSUBLINK spec/template, homogeneous_sequences, Type Sequences))
148149
)
149150

151+
$(SPEC_RUNNABLE_EXAMPLE_COMPILE
152+
---
153+
int* p; // pointer
154+
int[2] sa; // static array
155+
int[] da; // dynamic array/slice
156+
157+
int[string] aa; // associative array
158+
void function() fp; // function pointer
159+
160+
import std.meta : AliasSeq;
161+
AliasSeq!(int, string) tsi; // type sequence instance
162+
---
163+
)
164+
150165
$(H3 $(LNAME2 pointers, Pointers))
151166

152167
$(P A pointer to type $(D T) has a value which is a reference (address) to another

0 commit comments

Comments
 (0)