This website requires JavaScript.
About
Status
₊˚⊹Discord
Explore
Register
Sign in
Reference in a new issue
Blame
Copy permalink
Reference in a new issue
Copy permalink
DKB
/
zig
Star
0
Fork
You've already forked zig
0
mirror of
https://codeberg.org/ziglang/zig
synced
2026-11-18 07:05:05 +00:00
Code
Issues
Releases
Packages
Activity
88ea2cb757
zig
/
lib
/
std
/
bounded_array.zig
330 lines
12 KiB
Raw
Normal View
History
BoundedArray: a simple way to represent small data whose max size is known (#9134) This is a simple structure containing an array and a length, that can be viewed as a slice. It is useful to pass-by-copy small data whose exact size is known at runtime, but whose maximum size is known at comptime. This greatly simplifies code that otherwise would require an allocator, or reimplementing what this type does.
2021-08-24 13:59:28 +02:00
std.bounded_array: fix `self` parameter type in `constSlice` Because `.buffer` is an inline array field, we actually require `self` to be passed as a pointer. If the compiler decided to pass the object by copying, we would return a pointer to to-be-destroyed stack memory.
2021-11-19 12:08:28 +01:00
BoundedArray: a simple way to represent small data whose max size is known (#9134) This is a simple structure containing an array and a length, that can be viewed as a slice. It is useful to pass-by-copy small data whose exact size is known at runtime, but whose maximum size is known at comptime. This greatly simplifies code that otherwise would require an allocator, or reimplementing what this type does.
2021-08-24 13:59:28 +02:00
std.bounded_array: support inserting a new value at the end (#10340) Since `BoundedArray.insert` internally reserves space for the element to be inserted, it can support inserting at the position that is the current length of the array. Change the check for the insertion position to allow this.
2021-12-15 11:10:34 -08:00
BoundedArray: a simple way to represent small data whose max size is known (#9134) This is a simple structure containing an array and a length, that can be viewed as a slice. It is useful to pass-by-copy small data whose exact size is known at runtime, but whose maximum size is known at comptime. This greatly simplifies code that otherwise would require an allocator, or reimplementing what this type does.
2021-08-24 13:59:28 +02:00
BoundedArray: add appendAssumeCapacity
2021-11-10 14:36:08 -07:00
BoundedArray: a simple way to represent small data whose max size is known (#9134) This is a simple structure containing an array and a length, that can be viewed as a slice. It is useful to pass-by-copy small data whose exact size is known at runtime, but whose maximum size is known at comptime. This greatly simplifies code that otherwise would require an allocator, or reimplementing what this type does.
2021-08-24 13:59:28 +02:00
BoundedArray: add appendAssumeCapacity
2021-11-10 14:36:08 -07:00
BoundedArray: a simple way to represent small data whose max size is known (#9134) This is a simple structure containing an array and a length, that can be viewed as a slice. It is useful to pass-by-copy small data whose exact size is known at runtime, but whose maximum size is known at comptime. This greatly simplifies code that otherwise would require an allocator, or reimplementing what this type does.
2021-08-24 13:59:28 +02:00
std.bounded_array: support inserting a new value at the end (#10340) Since `BoundedArray.insert` internally reserves space for the element to be inserted, it can support inserting at the position that is the current length of the array. Change the check for the insertion position to allow this.
2021-12-15 11:10:34 -08:00
BoundedArray: a simple way to represent small data whose max size is known (#9134) This is a simple structure containing an array and a length, that can be viewed as a slice. It is useful to pass-by-copy small data whose exact size is known at runtime, but whose maximum size is known at comptime. This greatly simplifies code that otherwise would require an allocator, or reimplementing what this type does.
2021-08-24 13:59:28 +02:00