-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Introduce til::some #4123
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
Introduce til::some #4123
Conversation
src/inc/til.h
Outdated
| return _Elems; | ||
| } | ||
|
|
||
| void push_back(const _Ty& _Val) |
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.
@DHowett-MSFT, in vector, there's a lot about push_back turning into emplace_back which is very complicated. I'd like if you look over this with me and see if you can decode whether any of the stuff that is used for push/pop/emplace in things like vector is something we need here.
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.
not totally sure here. need to look a bit.
… to how I was templatizing the iterators.
DHowett-MSFT
left a comment
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.
NAK on using STL internals and perhaps deriving array
… privates, make a til test library, make some tests for some.
zadjii-msft
left a comment
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'll give you a check when the scripts are updated 😜
|
Whoa, did you murder the non-const versions of things? |
miniksa
left a comment
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.
Whoa, did you murder the non-const versions of things?
Yes because when I was testing it, you could use the non-const ones to edit things outside the _Used count pretty easily. Do you want them back? I think most of the use of this is to fill it up the once and then give it to someone to iterate constantly, so I don't think we need them.
nope, no need |
… some.h based on PR comments.
Summary of the Pull Request
Introduces a type that is basically an array (stack allocated, fixed size) that reports size based on how many elements are actually filled (from the front), iterates only the filled ones, and has some basic vector push/pop semantics.
PR Checklist
Detailed Description of the Pull Request / Additional comments
The original gist of this was used for
SomeViewportswhich was a struct to hold between 0 and 4 viewports, based on how many were left after subtraction (since rectangle subtraction functions in Windows code simply fail for resultants that yield >=2 rectangle regions.)I figured now that we're TIL-ifying useful common utility things that this would be best suited to a template because I'm certain there are other circumstances where we would like to iterate a partially filled array and want it to not auto-resize-up like a vector would.
Validation Steps Performed