You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Array0 has the handy into_scalar() method, which from what I gather roughly equates to calling arr.index(Ix0()).
Unfortunately, this isn't available for array views, so we're stuck using the more obscure and verbose syntax for ArrayView0 and ArrayViewMut0. It looks to me like it'd just be a matter to move the into_scalar() impl up to ArrayBase, letting the view representation choose the return type.
Would it be a breaking change? How difficult would it be to implement?
The text was updated successfully, but these errors were encountered:
I think @Palladinium may be referring to the .index() method from the IndexLonger trait. It's currently the best way to get an &'a A from an ArrayView0<'a, A, D>. (Note the matching lifetimes.)
I do think it would make sense to add .into_scalar() methods to ArrayView0 and ArrayViewMut0 for convenience. (Those types specifically, not all of ArrayBase<S, Ix0>.) It would not be a breaking change, and it would be easy to implement.
Array0
has the handyinto_scalar()
method, which from what I gather roughly equates to callingarr.index(Ix0())
.Unfortunately, this isn't available for array views, so we're stuck using the more obscure and verbose syntax for
ArrayView0
andArrayViewMut0
. It looks to me like it'd just be a matter to move theinto_scalar()
impl up toArrayBase
, letting the view representation choose the return type.Would it be a breaking change? How difficult would it be to implement?
The text was updated successfully, but these errors were encountered: