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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Container Types #180
base: master
Are you sure you want to change the base?
Improve Container Types #180
Changes from all commits
4756017
880f4bd
b6f4513
937f56d
6080dc9
00a2473
3ae9d42
9a904b4
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imo, things like
begin
,front
, etc. should only be STL style to not have duplicated. Wdyt?Same for DynArray, Span.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah definitely + from me on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you elaborate on what you mean a little? Im not sure if you're referring to just casing or something else aswell
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be either STL or our style (STL conformant or not), but not both, with only exceptions for compliance with named requirements, range-based for loop, etc. If we want to keep our naming, then it should be
Size()
,Begin()
,Front()
, etc. Things likebegin()
andend()
should be in a separate "compliance" region, not mixed in with the rest. What's the purpose of lowercasefront()
btw?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think lowercase
front
has any purpose, but I made a typo, I wanted to saybeing
,end
, etc. Basically, everything that is needed for range-based loop.For these requirements, I would say to just use the lowercase (STL variant) naming, instead of having both.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd keep
Begin
andEnd
for consistent naming (you still need to use them explicitly) and not considerbegin
andend
as part of our interface.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont know what you mean by consistent naming now - consistent with what? Other functions? Other collections not touched by this (if there are any)?
I would rather not have 2 functions doing the same thing personally, even if it would cause some function ToBeLikeThis and some like_this following std.
Mainly when they should be compatible with it, 2 of anything unnecessarily is a waste in my eyes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consistent across the class at least, ideally across the project.
begin
andend
should not be considered functions of a class, but unfortunately C++ doesn't have a way to handle it properly. For example, C# supports explicit interface implementation that would hidebegin
andend
from class.Begin
andbegin
have different purposes, and that's what matters, how they're implemented is irrelevant.begin
exists to support range-based for loop, for everything else there'sBegin
.