-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multiple vec fixes that are useful to implement canvas_ity. I found q…
…uite a bit of oddity in vector still. - Remove bizzarre idata() method, normally inout should not contaminate identifiers. Fixed that in strings, I supposed the goal was to not return mutable C string from numem string - vec.ptr() as alias to vec.data(), which is not inout. It fixed ref auto opOpAssign(string op = "~")(vector!T other) that uses other.ptr - vec.length as alias of vec.size - clear() and remove() will clean-up items in reverse manner just like the destructor, and only if not a basic type. - ref inout(T) opIndex. else you can't index vector fields in const methods - BREAKING remove is fixed (it was not possible to remove zero items with its API without crashing) and is now "delete [start, end)" instead of "delete [start, end]" Changed error recovery that swaps start and end to assertion. That makes the functions more similar in contract to c++ std::vector::erase and a bit more expected to me. IF the contract doesn't change, at least it should say plainly that this will crash if no items are removed.
- Loading branch information
Guillaume Piolat
committed
Oct 4, 2024
1 parent
0e03ca8
commit 6d97870
Showing
2 changed files
with
38 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters