Work in progress commit. Working on method operator overloading, fixed c-style block comments.

This commit is contained in:
Nathan Braswell
2014-03-14 15:55:45 -04:00
parent 663b124680
commit 3728a849de
6 changed files with 125 additions and 19 deletions

View File

@@ -24,4 +24,16 @@ bool contains(std::vector<T> vec, T item) {
return false;
}
template <typename T>
std::vector<T> slice(std::vector<T> vec, int begin, int end) {
std::vector<T> toReturn;
if (begin < 0)
begin += vec.size()+1;
if (end < 0)
end += vec.size()+1;
for (int i = begin; i < end; i++)
toReturn.push_back(vec[i]);
return toReturn;
}
#endif