Skip to content

Commit 44ca2e1

Browse files
committed
Added simple type casting trait to standard library
1 parent 0e1163f commit 44ca2e1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Diff for: infrastructure/import/std/_.adept

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
pragma => adept("3.0")
3+
4+
#[public]
5+
trait Cast<$From, $To> {
6+
func cast(from $From) $To
7+
}
8+
9+
#[public]
10+
#[using $cast Cast<$From, $To>]
11+
func cast<$To>(from $From) $To {
12+
return $cast::cast(from)
13+
}
14+

0 commit comments

Comments
 (0)