-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[C++] Add operator[] to some concrete Array implementations? #22660
Comments
Francois Saint-Jacques / @fsaintjacques: |
Antoine Pitrou / @pitrou: typename IteratorType::ValueType operator[](int64_t i) {
return *IteratorType(*this, i);
} |
Pradeep Garigipati / @9prady9: bool BooleanArray::operator[](int64_t i) const { return GetView(i); }
value_type NumericArray::operator[](int64_t i) const { return GetView(i); }
TypeClass::DayMilliseconds DayTimeIntervalArray::operator[](int64_t i) const { return GetView(i); }
TypeClass::MonthDayNanos MonthDayNanoIntervalArray::operator[](int64_t i) const { return GetView(i); } |
Antoine Pitrou / @pitrou: |
Pradeep Garigipati / @9prady9: Thank you for the clarification. I have raised the PR, please have a look. |
Eduardo Ponce / @edponce: |
Antoine Pitrou / @pitrou: |
I have occasionally been in situations where I want to pass in e.g.
Int32Array
orBooleanArray
into a template that also can accept STL sequence types likestd::vector<bool>
– in such cases the main API of interest is[]
. Would there be interest in aliasingoperator[]
to return the result ofGetView
(or to deprecateGetView
in favor ofoperator[]
)?Reporter: Wes McKinney / @wesm
Assignee: Pradeep Garigipati / @9prady9
Related issues:
PRs and other links:
Note: This issue was originally created as ARROW-6276. Please see the migration documentation for further details.
The text was updated successfully, but these errors were encountered: