Fixed up vector and make template searching functions use std::set to remove false positives on multiple matching templates

This commit is contained in:
Nathan Braswell
2015-01-07 03:03:14 -05:00
parent b66e8cbaa5
commit ad0e90f74a
2 changed files with 11 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
import mem;
import util;
import io;
import mem:*;
import util:*;
import io:*;
typedef template<T> vector (Destructable) {
|T*| data;
@@ -27,11 +27,11 @@ typedef template<T> vector (Destructable) {
delete<T>(data, 0);
return true;
}
|T| at(|int| index) {
return get(index);
}
|T| get(|int| index) {
if (index < 0 || index >= size) {
println("Vector access out of bounds! Retuning 0th element as sanest option");