Add comments to generics example

This commit is contained in:
Mattia Giambirtone 2024-02-19 17:19:55 +01:00
parent ee90dad3d2
commit c3bac2cf46
Signed by: nocturn9x
GPG Key ID: 8270F9F467971E59
1 changed files with 4 additions and 0 deletions

View File

@ -14,11 +14,15 @@ type int64 = object {
# as possible. This syntax is very useful in cases like the built-in array type: it allows the syntax for it
# to be just array[T, N], where T is the type of its elements and N is its size
type Test<T: int64>[V: int64] = object {
## This structure holds both the int64 type
## and a value of type int64
typeObj: T;
value: V;
}
type Test2<T: Test>[V: Test] = object {
## This structure holds both the Test
## type and a (concrete) instance of Test
typeObj: T;
value: V;
}