Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
v
/
tests
/
generics
/
generics_from_modules
/
newmodule
/
newmodule.v
18
lines
·
16
sloc
·
217 bytes
·
6488041a749df9762348d019c4223908c476f2e2
Raw
1
module
newmodule
2
3
pub
struct
Params[T] {
4
pub
mut
:
5
a []T
6
b int
7
c T
8
}
9
10
pub
fn
take_input[T](p Params[T]) []f32 {
11
mut
res := []f32{}
12
for
x
in
p.a {
13
res << f32(x)
14
}
15
res << f32(p.b)
16
res << f32(p.c)
17
return
res
18
}
19