Scene/unit iterator things fix#18
Merged
CoraBlack merged 5 commits intogkit-org:scene/unitfrom Feb 21, 2026
Merged
Conversation
Contributor
|
Don't imply your code in header files |
Contributor
Author
Ok I will fix it soon. |
CoraBlack
reviewed
Feb 20, 2026
Comment on lines
+259
to
+270
| // Why this part didn't use auto, because it need to have a const_iterator use | ||
| // but auto could not allow two same function but with different return | ||
| // but begin() and end() need those two return | ||
| // So I will not change it | ||
| iterator begin() { | ||
| return iterator(this, 0); | ||
| } | ||
|
|
||
| iterator end() { | ||
| return iterator(this, active_index_cache.size()); | ||
| } | ||
|
|
CoraBlack
reviewed
Feb 20, 2026
src/core/include/scene/unit.hpp
Outdated
Comment on lines
+320
to
+345
| const_iterator begin() const{ | ||
| const_cast<Unit*>(this); | ||
| return const_iterator(this, 0); | ||
| } | ||
|
|
||
| const_iterator end() const { | ||
| const_cast<Unit*>(this); | ||
| return const_iterator(this, active_index_cache.size()); | ||
| } | ||
|
|
||
| const_iterator cbegin() const { return begin(); } | ||
| const_iterator cend() const { return end(); } | ||
|
|
||
| public: | ||
| // This is a reverse iterator, implemented using std::reverse_iterator. | ||
| using reverse_iterator = std::reverse_iterator<iterator>; | ||
| using const_reverse_iterator = std::reverse_iterator<const_iterator>; | ||
|
|
||
| reverse_iterator rbegin() { return reverse_iterator(end()); } | ||
| reverse_iterator rend() { return reverse_iterator(begin()); } | ||
|
|
||
| const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); } | ||
| const_reverse_iterator rend() const { return const_reverse_iterator(begin()); } | ||
|
|
||
| const_reverse_iterator crbegin() const { return rbegin(); } | ||
| const_reverse_iterator crend() const { return rend(); } |
CoraBlack
requested changes
Feb 20, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.