mirror of
https://github.com/odin-lang/Odin.git
synced 2026-10-09 22:32:13 -04:00
Implement call expressions
This commit is contained in:
1 parent
b09ea17f0e
commit
4654b41c3e
4 files changed
+201
-6
No files matched your search
@@ -168,6 +168,17 @@ gb_internal gb_inline Slice<T> slice(Slice<T> const &array, isize lo, isize hi)
|
||||
}
|
||||
return out;
|
||||
}
|
||||
template <typename T>
|
||||
gb_internal gb_inline Slice<T> slice(Array<T> const &array, isize lo, isize hi) {
|
||||
GB_ASSERT(0 <= lo && lo <= hi && hi <= array.count);
|
||||
Slice<T> out = {};
|
||||
isize len = hi-lo;
|
||||
if (len > 0) {
|
||||
out.data = array.data+lo;
|
||||
out.count = len;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
template <typename T>
|
||||
|
||||
Reference in new issue
Block a user