Modified I/O in the vector class

This commit is contained in:
Chris Fadden
2015-03-16 14:01:15 -04:00
parent 2b2c443912
commit a268f1b768
11 changed files with 4 additions and 521 deletions

View File

@@ -1,6 +1,6 @@
import mem:*;
import util:*;
//import io:*;
import io:*;
typedef template<T> vector (Destructable) {
|T*| data;
@@ -36,7 +36,9 @@ typedef template<T> vector (Destructable) {
|T| get(|int| index) {
if (index < 0 || index >= size) {
// println("Vector access out of bounds! Retuning 0th element as sanest option");
println("Vector access out of bounds! Retuning 0th element as sanest option");
print("Vector tried to access element: ");
println(index);
return data[0];
}
return data[index];