soa_vector maybe shouldn't use get
set
members.
#917
DenisYaroshevskiy
started this conversation in
Done & Done!
Replies: 1 comment
-
Decided that it's fine |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Why?
Because of confusion with non-member
get
.Also we have the same confusion with wide...
We can have get_at or set_at for example? Or smth.
Explanation:
Assume:
point2D
- product over <int, int>line2D
- product ove <point2D, point2D>.On one hand, would be nice to be able:
However, providing
get<0>
get<1>` on soa_vector is problemating.Consider structure bindings:
NOT DOABLE:
We can't do that. Because structured bindings needs real references, and inside
soa_vector
we won't store anything reminding us ofpoint
.Ideally, at some point, we would just store a pointer to one allocated chunk of memory that's it.
So non-member
get
on soa_vector won't fly,BUT:
I think we should have an
soa_view<T>
(or smth).And there I think we should store the extra wrappers that'd allow us to reference directly some parts.
I think this should be OK:
So this kind of
soa_view
needs to have aget<0>(soa_view)
and also needs to have the same interface assoa_vector
=>view.get(3)
-> line.Beta Was this translation helpful? Give feedback.
All reactions