Adding in proper copy_construct into function calls and destruct afterwards. Doesn't correctly destruct return values yet.

This commit is contained in:
Nathan Braswell
2016-05-21 11:20:29 -07:00
parent cf8090f825
commit 828f36daab
5 changed files with 100 additions and 54 deletions

View File

@@ -47,7 +47,7 @@ fun print(toPrint: double) {
var int_str = new<char>(how_much+2)
snprintf(int_str, (how_much+1) cast ulong, "%f", toPrint)
print(int_str)
/*delete(int_str)*/
delete(int_str)
}
fun print<T>(toPrint: T): void
print(string::to_string(toPrint))