Add comments to generics example
This commit is contained in:
parent
548e5e54e2
commit
ecad09d3dd
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue