added proper template function instantiation caching

This commit is contained in:
Nathan Braswell
2016-02-03 21:57:06 -05:00
parent 1ea07d4f92
commit de3ead0573
5 changed files with 49 additions and 22 deletions

View File

@@ -5,6 +5,12 @@ import serialize
// maybe my favorite function
fun do_nothing() {}
fun deref_equality<T>(a: *T, b: *T): bool {
if ( (a && b && !(*a == *b)) || (a && !b) || (!a && b) )
return false
return true
}
fun max<T>(a: T, b: T): T {
if (a > b)
return a;